byexamples / byexamples/byexample
Use a monotonic clock instead of `time.time()`
- Dominant language
- Python
- Stars
- 67
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the feature you'd like**
`time.time()` is sensible to time shifts due to clock readjustments via NTP
or others.
This may lead to unexpected timeouts, event to absurd elapsed time
notifications (like saying that an example took hours)
The new Python 3.x's [monotonic clock](https://docs.python.org/3/library/time.html#time.monotonic) should be immune to these.
The codes that use `time.time()` to calculate delta of times are:
- https://github.com/byexamples/byexample/blob/338911310018f21fe9f1cdb90ddcde6069626fc3/byexample/modules/progress.py#L67
- https://github.com/byexamples/byexample/blob/338911310018f21fe9f1cdb90ddcde6069626fc3/byexample/common.py#L395
- https://github.com/byexamples/byexample/blob/338911310018f21fe9f1cdb90ddcde6069626fc3/byexample/expected.py#L503
Contributor guide
Assessment
This issue has not been assessed yet.