| 39 | const char* SC::Time::Absolute::ParseResult::getDay() const { return dayName; } |
| 40 | |
| 41 | SC::Time::Realtime SC::Time::Realtime::now() |
| 42 | { |
| 43 | #if SC_PLATFORM_WINDOWS |
| 44 | struct _timeb t; |
| 45 | _ftime_s(&t); |
| 46 | return static_cast<int64_t>(t.time) * 1000 + t.millitm; |
| 47 | #else |
| 48 | struct timespec nowTimeSpec; |
| 49 | clock_gettime(CLOCK_REALTIME, &nowTimeSpec); |
| 50 | constexpr int64_t nanosecondsToMilliseconds = 1000 * 1000; |
| 51 | constexpr int64_t roundingNanoseconds = nanosecondsToMilliseconds / 2; |
| 52 | return static_cast<int64_t>(nowTimeSpec.tv_sec) * 1000 + |
| 53 | (static_cast<int64_t>(nowTimeSpec.tv_nsec) + roundingNanoseconds) / nanosecondsToMilliseconds; |
| 54 | #endif |
| 55 | } |
| 56 | |
| 57 | SC::Time::Monotonic SC::Time::Monotonic::now() |
| 58 | { |
no outgoing calls
no test coverage detected