Found 1301 Articles for MCA

What is the difference between time.clock() and time.time()?

Rajendra Dharmkar
Updated on 30-Jul-2019 22:30:21

434 Views

The function time.time() returns the time in seconds since the epoch, i.e., the point where the time starts.For Unix, the epoch is January 1, 1970. For Windows, the epoch is January 1, 1601.time.time() is used for benchmarking on Windows. time.time() behaves the same on both UNIX and Windows but time.clock() has different meanings.On UNIX, time.clock returns the current processor time expressed in seconds, i.e., the CPU time it takes to execute the current thread so far. While on Windows, it returns the wall-clock time expressed in seconds elapsed since the first call to this function, based on the Win32 function ... Read More

Advertisements