Fix timing.c and test for timing.c