Python 3 Update: time.clock()
was removed in Python 3.3, consider using time.perf_counter()
instead.
time.time()
is measuring elapsed time since the Unix epoch (a reference point in 1970).
time.clock()
is measuring processor time, which isn't a date or time in seconds.
time.perf_counter()
is measuring time passing by with the highest precision available on the current platform.
Processor clock time is an approximation of how much time is spent in the CPU to execute instructions. Historically, a processor running at 3 GHz would have 3 billion ticks per second, but modern processors don't operate exactly like that anymore.
Clock time is used for benchmarking where extreme precision is required (in the order of nanoseconds). Most time functions are meant for human time/date and may only be accurate to a millisecond or so. Vary with the OS and platform.
Python 3.3 redid time functions. It added some easy-to-use functions that work across platforms (time.perf_counter) and it exposed some platform-specific functions for advanced use cases.
https://docs.python.org/3/library/time.html