Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

How to convert Python time.monotonic to walltime accurately

$
0
0

I have a time returned by time.monotonic() that I want to convert to walltime (i.e. time.time(), suitable for formatting with time.strftime). Is there a precise/atomic way to get the offset between both? I know I can just request both time.monotonic() and time.time() at an arbitrary point in time and calculate the difference, but this is inaccurate because there will be some delay between both calls (quite a lot since Python is slow, even more if there happen to be interrupts/rescheduling).


Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>