Skip to content

Conversation

@ghaerr
Copy link
Owner

@ghaerr ghaerr commented Sep 15, 2023

Fixes time command sometimes displaying incorrect results, reported by @Vutshi in #1619 (comment).

time would report incorrect results (e.g. an extremely large number) when a command would execute for a period of time where the number of seconds since Jan , 1970 would "wrap" during a modulo 3600 operation. Long story short, previously time used microsecond time calculations with a 32-bit long which was subjected to the improper 3600 second modulo operation approximately every hour GMT. It has been rewritten to use 64-bit arithmetic and is no longer subject to any time modulus.

The times C library routine has been removed due to being incorrect, and an alternative method used to get times in time.

@Vutshi, time sl -s should display properly now, although I don't expect you to actually wait 34 minutes to test it!

@Vutshi
Copy link
Contributor

Vutshi commented Sep 15, 2023

although I don't expect you to actually wait 34 minutes to test it!

This shall be done.

@ghaerr ghaerr merged commit 69a1c08 into master Sep 15, 2023
@ghaerr ghaerr deleted the time branch September 15, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants