Advance time with each time(), gettimeofday(), etc. call

Hi,
This patch may be useful for making programs which require advancement in time run in a deterministic way.