mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix copy-paste error of calculation of suspending time in Clock.cpp (#85545)
We should be assigning the value to suspension, not continuous!
This commit is contained in:
@@ -188,8 +188,8 @@ switch (clock_id) {
|
|||||||
#elif WE_HAVE_STD_CHRONO
|
#elif WE_HAVE_STD_CHRONO
|
||||||
auto num = std::chrono::steady_clock::period::num;
|
auto num = std::chrono::steady_clock::period::num;
|
||||||
auto den = std::chrono::steady_clock::period::den;
|
auto den = std::chrono::steady_clock::period::den;
|
||||||
continuous.tv_sec = num / den;
|
suspending.tv_sec = num / den;
|
||||||
continuous.tv_nsec = (num * 1'000'000'000ll) % den
|
suspending.tv_nsec = (num * 1'000'000'000ll) % den
|
||||||
#else
|
#else
|
||||||
#error Missing platform suspending time definition
|
#error Missing platform suspending time definition
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user