Add timing to replace.c