@brief Get current time in milliseconds since epoch (realtime clock)
| 29 | { |
| 30 | //! @brief Get current time in milliseconds since epoch (realtime clock) |
| 31 | inline TimeMs PluginNow() |
| 32 | { |
| 33 | #if SC_PLATFORM_WINDOWS |
| 34 | struct _timeb t; |
| 35 | _ftime_s(&t); |
| 36 | return {static_cast<int64_t>(t.time) * 1000 + t.millitm}; |
| 37 | #else |
| 38 | struct timespec nowTimeSpec; |
| 39 | clock_gettime(CLOCK_REALTIME, &nowTimeSpec); |
| 40 | return {static_cast<int64_t>((nowTimeSpec.tv_nsec >> 20) + nowTimeSpec.tv_sec * 1000)}; |
| 41 | #endif |
| 42 | } |
| 43 | |
| 44 | } // anonymous namespace |
| 45 | } // namespace SC |
no outgoing calls
no test coverage detected