Created
May 17, 2022 08:42
-
-
Save mikf/09f72c6187d4e6f874e548971c385899 to your computer and use it in GitHub Desktop.
python clock info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import sys | |
def get_clock_info(): | |
clock_info = [] | |
for name in ("monotonic", "perf_counter", "process_time", | |
"thread_time", "time"): | |
info = time.get_clock_info(name) | |
clock_info.append(f"""\ | |
{name}: | |
- adjustable: {info.adjustable} | |
- implementation: {info.implementation} | |
- monotonic: {info.monotonic} | |
- resolution: {info.resolution} | |
""") | |
return clock_info | |
if __name__ == "__main__": | |
sys.stdout.write("\n".join(get_clock_info())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment