aboutsummaryrefslogtreecommitdiff
path: root/absl/time
Commit message (Collapse)AuthorAgeFilesLines
* LSC: Move expensive variables on their last use to avoid copies.Abseil Team2024-06-171-1/+2
| | | | | PiperOrigin-RevId: 644150551 Change-Id: I11f3f8463fcfdb8d0284b1ab320624bbce6d1e48
* Import of CCTZ from GitHub.Abseil Team2024-04-241-1/+1
| | | | | PiperOrigin-RevId: 627807723 Change-Id: I106cfe4d3d614b26422f632e856397b8bdcf743e
* Use _decimal_ literals for the CivilDay example.Devin Jeanpierre2024-04-021-2/+2
| | | | | | | Using `07` is a neat pun, but it not friendly to the reader. If the reader naively copies it and then changes the `7` to an `8` or a `9`, it will fail compilation: `invalid digit ... in octal constant`. Best avoided. Note that the other examples do not use octal literals. PiperOrigin-RevId: 621335289 Change-Id: I6b11a639c5ba675eb29467baf45996ceff0ed9bf
* Use UnixEpoch and ZeroDurationAbseil Team2024-03-121-56/+61
| | | | | PiperOrigin-RevId: 615047295 Change-Id: I86e5de8543dc1ebee6d5a526846e9121b241b0fa
* Optimize `absl::Duration` division and modulo: Avoid repeated redundant ↵Abseil Team2024-02-271-27/+29
| | | | | | | comparisons in `IDivFastPath`. PiperOrigin-RevId: 610758911 Change-Id: I3d0fa2f52a3bd75bdd2b5c365d79878b4160bd29
* Optimize `absl::Duration` division and modulo: Allow the compiler to inline ↵Abseil Team2024-02-273-54/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | `time_internal::IDivDuration`, by splitting the slow path to a separate function. With that change, the compiler can inline the fast path. This is specially important in the context of `Duration::operator%=`, because it allows proving that the return value is unused, therefore avoiding expensive multiplies and divides (e.g. `*q = num_hi / den_hi;`). ``` name old cpu/op new cpu/op delta BM_Duration_Modulo 23.1ns ± 0% 22.5ns ± 0% -2.42% (p=0.000 n=20+16) BM_Duration_Modulo_FastPath 7.05ns ± 0% 4.85ns ± 0% -31.17% (p=0.000 n=20+20) name old time/op new time/op delta BM_Duration_Modulo 23.1ns ± 0% 22.6ns ± 0% -2.43% (p=0.000 n=20+16) BM_Duration_Modulo_FastPath 7.06ns ± 0% 4.86ns ± 0% -31.18% (p=0.000 n=20+20) name old INSTRUCTIONS/op new INSTRUCTIONS/op delta BM_Duration_Modulo 188 ± 0% 178 ± 0% -5.32% (p=0.000 n=20+20) BM_Duration_Modulo_FastPath 84.0 ± 0% 62.0 ± 0% -26.19% (p=0.000 n=20+20) name old CYCLES/op new CYCLES/op delta BM_Duration_Modulo 73.8 ± 0% 72.1 ± 0% -2.27% (p=0.000 n=19+20) BM_Duration_Modulo_FastPath 22.5 ± 0% 15.5 ± 0% -31.13% (p=0.000 n=19+20) ``` Note: We don't need to expose `absl::time_internal::IDivDuration` at all given that we have a public `absl::IDivDuration`. PiperOrigin-RevId: 610710635 Change-Id: Ief7c3d5b1c000b397d931e9249edcaef96e7151e
* Import of CCTZ from GitHub.Abseil Team2024-02-221-29/+0
| | | | | PiperOrigin-RevId: 609351346 Change-Id: I40f44d42efe65fd8ca1a441e69a0769c87938b20
* Import of CCTZ from GitHub.Derek Mauro2024-02-2015-5/+7
| | | | | PiperOrigin-RevId: 608705933 Change-Id: I9c11d8d8b3d9057bdf215863210f450332cf56cb
* Remove deprecated symbol absl::kuint128maxDerek Mauro2024-02-121-1/+1
| | | | | | absl::kuint128max should be replaced with absl::Uint128Max() PiperOrigin-RevId: 606279299 Change-Id: Ib67b5431f14891f56bb706e62f183d0de75d335f
* Decrease the precision of absl::Now in x86-64 debug buildsFangrui Song2024-02-011-1/+15
| | | | | | | | | | | | | | | | | | 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
* Replace `testonly = 1` with `testonly = True` in abseil BUILD files.Shahriar Rouf2024-01-311-1/+1
| | | | | | | https://bazel.build/build/style-guide#other-conventions PiperOrigin-RevId: 603084345 Change-Id: Ibd7c9573d820f88059d12c46ff82d7d322d002ae
* Import of CCTZ from GitHub.Abseil Team2023-12-2648-30/+329
| | | | | PiperOrigin-RevId: 593889663 Change-Id: I589cd18922172d8aca99ddcc0d6f08a013bed9b4
* Import of CCTZ from GitHub.Abseil Team2023-12-261-13/+0
| | | | | PiperOrigin-RevId: 593814844 Change-Id: If1967814b2b9273061b928bfee102faae1fad263
* Include `cstdint` where necessary.Dmitri Gribenko2023-12-261-0/+2
| | | | | PiperOrigin-RevId: 593780380 Change-Id: Id80217c63dd76bafbcfb79a7ee10807f1b771cb2
* Support AbslStringify in absl Civil Time types.Abseil Team2023-11-142-1/+45
| | | | | PiperOrigin-RevId: 582342910 Change-Id: Iada5420867779ed352d8fb0695ff6d6044acfba2
* Import of CCTZ from GitHub.Abseil Team2023-11-081-1/+9
| | | | | PiperOrigin-RevId: 580538328 Change-Id: I2699c77eeb68708584231d86ae2c0fca4870c17e
* Import of CCTZ from GitHub.Derek Mauro2023-10-111-1/+5
| | | | | PiperOrigin-RevId: 572591515 Change-Id: I7d2bd1f737efeeecb8a063ae94a696315bb14532
* Bazel: Enable the header_modules featureDerek Mauro2023-10-112-1/+5
| | | | | PiperOrigin-RevId: 572575394 Change-Id: Ic1c5ac2423b1634e50c43bad6daa14e82a8f3e2c
* Bazel: Support layering_check and parse_headersDerek Mauro2023-10-101-1/+9
| | | | | | | | | | | | | The layering_check feature ensures that rules that include a header explicitly depend on a rule that exports that header. Compiler support is required, and currently only Clang 16+ supports diagnoses layering_check failures. The parse_headers feature ensures headers are self-contained by compiling them with -fsyntax-only on supported compilers. PiperOrigin-RevId: 572350144 Change-Id: I37297f761566d686d9dd58d318979d688b7e36d1
* Import of CCTZ from GitHub.Abseil Team2023-09-232-224/+1
| | | | | PiperOrigin-RevId: 567869792 Change-Id: I29948282b57b401f3199dc41160538aa9a8079a7
* Import of CCTZ from GitHub.Abseil Team2023-09-061-2/+2
| | | | | PiperOrigin-RevId: 563201556 Change-Id: I2e1abde3944f3f3db532ce15db12adaf89207515
* Import of CCTZ from GitHub.Abseil Team2023-08-291-1/+1
| | | | | PiperOrigin-RevId: 561095618 Change-Id: I1834e0155b05b9984145504d5925dc6fa8a3933b
* Include what you spellDmitri Gribenko2023-08-111-3/+3
| | | | | PiperOrigin-RevId: 555894810 Change-Id: I349c94e7c6e7ba1dbd817aa8e4340c1dada84654
* Fixed shared Windows build in Chrome when building MediaPipe.Abseil Team2023-08-101-1/+3
| | | | | | | The MediaPipe library calls absl::SleepFor() but that causes linker errors in Chrome's (non-production) shared library build because AbslInternalSleepFor isn't exported. PiperOrigin-RevId: 555699667 Change-Id: I95033857ec13ed72ff2a80001878b5e35bbeee91
* Fix warnings:Dmitri Gribenko2023-08-081-5/+8
| | | | | | | | * 'DoNotOptimize<T>' is deprecated: The const-ref version of this method can permit undesired compiler optimizations in benchmarks * missing #include <string> for 'std::string' PiperOrigin-RevId: 554936149 Change-Id: Iaf06cd9b9b0762e3a514b7e1cfe4a4fd6df24083
* Add missing include for <iomanip>Derek Mauro2023-08-081-0/+1
| | | | | PiperOrigin-RevId: 554817008 Change-Id: If18f5992e2a65ce2e3e3cf7e0732767676c4320c
* Import of CCTZ from GitHub.Abseil Team2023-08-041-3/+8
| | | | | PiperOrigin-RevId: 553878129 Change-Id: I054a5bd4c9011155c9fe03df0f07803ad7d2ade3
* Import of CCTZ from GitHub.Abseil Team2023-08-012-6/+9
| | | | | PiperOrigin-RevId: 552848883 Change-Id: Ibcf4b59e2ab671d8dd8fddcbc9d74d4c8cd3f0ff
* PR #1495: CMake: Link CoreFoundation with -frameworkDaniel Schürmann2023-07-311-5/+3
| | | | | | | | | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1495 This fixes https://github.com/abseil/abseil-cpp/issues/1494 With CMake 3.24 we can also use `$<LINK_LIBRARY:FRAMEWORK,CoreFoundation>` but abseil is still at CMake 3.10 The change has been tested here: https://github.com/daschuer/vcpkg/actions/runs/5670741925 Merge f3ff6bc01ff45970d2b803ca51421483b423b72b into c9c0fd5185067208e1cc4227d16122571762af39 Merging this change closes #1495 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1495 from daschuer:framework-link-fix f3ff6bc01ff45970d2b803ca51421483b423b72b PiperOrigin-RevId: 552564485 Change-Id: I57b580e5795c54865576110e56220128d8b603b8
* Import of CCTZ from GitHub.Abseil Team2023-07-252-5/+6
| | | | | PiperOrigin-RevId: 550964088 Change-Id: I54e4bff1cf72442c34e1668dbe8af9337eb0aa46
* Import of CCTZ from GitHub.Abseil Team2023-06-292-0/+2
| | | | | PiperOrigin-RevId: 544445872 Change-Id: Ic7d42dca3461babdf8a6dff4c73a1596e795ffb2
* Roll forward of CCTZ update; fixed by clang release.Abseil Team2023-06-2811-316/+351
| | | | | PiperOrigin-RevId: 544146637 Change-Id: I5ca44465f451956ae246081ce826891599b18b9c
* Rollback of CCTZ update due to crash in clang ObjcLink.Abseil Team2023-06-2811-351/+316
| | | | | PiperOrigin-RevId: 544060862 Change-Id: I6ca631385826f6e10f6c3eeec1af532402d0b532
* Import of CCTZ from GitHub.Gennadiy Rozental2023-06-2711-316/+351
| | | | | PiperOrigin-RevId: 543896343 Change-Id: Ia91b3e082b764b750bbbe9a3ce63192263d51438
* Import of CCTZ from GitHub.Abseil Team2023-06-092-4/+17
| | | | | PiperOrigin-RevId: 539104398 Change-Id: I6385662e0c5694d40c57887f983b16adc9eced14
* Import of CCTZ from GitHub.Abseil Team2023-06-063-35/+49
| | | | | PiperOrigin-RevId: 538241594 Change-Id: Ie6f0d913bcf07dea2f33e47198ba952b3800d70e
* Import of CCTZ from GitHub.Abseil Team2023-06-051-5/+6
| | | | | PiperOrigin-RevId: 537825067 Change-Id: I3ce8712d5130068fb7d77b563eb502e2e9560810
* Merge pull request #1457 from juergbi:time-threadsCopybara-Service2023-06-011-0/+1
|\ | | | | | | | | PiperOrigin-RevId: 537088042 Change-Id: I6ef219a1a76baf3a751a6084a8fb8639c9bdac51
| * CMake: Link `time_zone` library to `Threads::Threads`Jürg Billeter2023-05-241-0/+1
| | | | | | | | `time_zone_impl.cc` uses `std::mutex`.
* | Disable the use of the fast GetCurrentTimeNanos() algorithm based onDerek Mauro2023-05-261-7/+6
|/ | | | | | | | | | the cyclecounter by default, since it may be unsafe in some situations (for example, if the system may enter a sleep state). Fixes #1460 PiperOrigin-RevId: 535641718 Change-Id: I41c9cc4bc7a8ae7280ff9df00abd57668205045b
* Import of CCTZ from GitHub.Abseil Team2023-05-222-3/+124
| | | | | PiperOrigin-RevId: 534150392 Change-Id: I4c0c111202178031e08d9edad3a4501800d924f0
* Import of CCTZ from GitHub.Derek Mauro2023-05-192-207/+302
| | | | | PiperOrigin-RevId: 533455360 Change-Id: Ia95b225f8c186a831801f1ee008d7a5c0fff544b
* Add compiler deprecation warnings for absl::ConvertDateTime() and ↵Derek Mauro2023-05-172-7/+21
| | | | | | | | | | | | | | absl::FromDateTime(). These have been marked deprecated in the comments for some time, (since f340f773edab951656b19b6f1a77c964a78ec4c2) but the warnings were never enabled. A warning suppression is enabled for Abseil code so that when we declare types in our code, we don't get a warning. PiperOrigin-RevId: 532891102 Change-Id: Ife0c5696a061ea44769e02869e4e3d1196e86f9d
* Fix spelling mistakesVertexwahn2023-05-022-2/+2
|
* Fix some spelling mistakesVertexwahn2023-04-241-1/+1
|
* Prefer copy_n and fill_n over copy and fill where appropriate.Rose2023-04-191-1/+1
| | | | This lets us avoid having to do the addition manually.
* Reland "Get rid of tail padding within `absl::Duration`. This reduces memory ↵Abseil Team2023-04-143-20/+106
| | | | | | | usage needs when storing duration in containers (e.g. `vector<absl::Duration>` uses 25% less memory), and allows classes with `absl::Duration` fields to fit other stuff in memory previously used by tail padding (e.g. `std::optional<absl::Duration>` is now 16 bytes instead of 24)." PiperOrigin-RevId: 524256689 Change-Id: Ibf40d9e5411020179fa34c972349c7b58aa9d908
* Add commentary for universal time scaleAbseil Team2023-04-041-5/+8
| | | | | PiperOrigin-RevId: 521932692 Change-Id: If637de6501a4ac41f0078d581049d23aad3480a4
* Remove ABSL_SKIP_TIME_TESTS_BROKEN_ON_MSVC_OPT. These testsDerek Mauro2023-04-032-45/+0
| | | | | | | were broken on MSVC 2017, but MSVC 2017 is no longer supported PiperOrigin-RevId: 521527454 Change-Id: I7203708bdc9aa03c9764c9c36db7ce5777e43c3c
* Import of CCTZ from GitHub.Abseil Team2023-03-282-1/+1
| | | | | PiperOrigin-RevId: 520197681 Change-Id: I96d0253b61bb683bf30060a9b4c19e2c9dce629b