Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /spraakbanken_karp-backend /src /karp /foundation /timings.py
| """Time utilities.""" | |
| import math | |
| from datetime import datetime, timezone | |
| def utc_now() -> float: | |
| """A UTC timestamp in seconds. | |
| This function may return the same timestamp twice. | |
| """ | |
| return datetime.now(timezone.utc).timestamp() | |
| _previous: float = utc_now() | |
| def monotonic_utc_now() -> float: | |
| """A UTC timestamp in seconds. | |
| This function will never return the same result twice. | |
| """ | |
| global _previous | |
| result = utc_now() | |
| if result <= _previous: | |
| result = math.nextafter(result, math.inf) | |
| _previous = result | |
| return result | |
Xet Storage Details
- Size:
- 583 Bytes
- Xet hash:
- d89bb99c3b1c6c391fe6aada80edbc9bcab65e27f7e6f7a46ce9315e243a858b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.