Code in C to measure time