Might want to inject the time as well so time() is only called once and you get the time deltas you expect.