Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] increase float precision of time APIs (boot_time(), users(), proc create_time() #1693

Merged
merged 4 commits into from Feb 13, 2020

Conversation

giampaolo
Copy link
Owner

@giampaolo giampaolo commented Feb 13, 2020

Right now both values are expressed in seconds and have a 1 second precision.

>>> import psutil
1581522914.0
>>> psuti.boot_time()
1581522614.0

With this PR we should get up to nano seconds precision (provided by 2 native system APIs):

>>> import psutil
1581522914.3436192
>>> psuti.boot_time()
1581522614.02836111

@giampaolo giampaolo merged commit b0cff82 into master Feb 13, 2020
@giampaolo giampaolo deleted the win-time-precision branch February 13, 2020 21:29
@giampaolo
Copy link
Owner Author

It turns out also users() login time can benefit of the better precision. Done in c67ab01.

@giampaolo giampaolo changed the title [Windows] increase precision of boot_time() and proc create_time() [Windows] increase precision of boot_time(), users() login time and proc create_time() Feb 14, 2020
@giampaolo giampaolo changed the title [Windows] increase precision of boot_time(), users() login time and proc create_time() [Windows] increase float precision of time APIs (boot_time(), users(), proc create_time() Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant