CycleClock::Now utilizes ABSL_INTERNAL_CYCLECLOCK_SHIFT to discourage reliance on the raw CPU cycle counter values. As a side effect, it discourages strictly-increasing assumption. Apply the idea to discourage over-reliance on the precision of absl::Now/absl::GetCurrentTimeNanos. Programs relying on a very high precision often exhibit portability issues on machines with a lower cycle counter precision, or worse, race conditions. For example, Apple M1 emulated x86 RDTSC only guarantees weakly-increasing RDTSC values. x86 clock speed is usually measured in GHz and is still precise after we drop 8 least significant bits. PiperOrigin-RevId: 603493500 Change-Id: Ib1b00075109283f5dbcb39a43fe0ab722351a1e2
| Name |
Last commit
|
Last Update |
|---|---|---|
| .github | Loading commit data... | |
| CMake | Loading commit data... | |
| absl | Loading commit data... | |
| ci | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .gitignore | Loading commit data... | |
| ABSEIL_ISSUE_TEMPLATE.md | Loading commit data... | |
| AUTHORS | Loading commit data... | |
| BUILD.bazel | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.md | Loading commit data... | |
| FAQ.md | Loading commit data... | |
| LICENSE | Loading commit data... | |
| MODULE.bazel | Loading commit data... | |
| PrivacyInfo.xcprivacy | Loading commit data... | |
| README.md | Loading commit data... | |
| UPGRADES.md | Loading commit data... | |
| WORKSPACE | Loading commit data... | |
| WORKSPACE.bzlmod | Loading commit data... | |
| conanfile.py | Loading commit data... | |
| create_lts.py | Loading commit data... |