MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / PluginNow

Function PluginNow

Libraries/Plugin/Plugin.cpp:31–42  ·  view source on GitHub ↗

@brief Get current time in milliseconds since epoch (realtime clock)

Source from the content-addressed store, hash-verified

29{
30//! @brief Get current time in milliseconds since epoch (realtime clock)
31inline 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

Callers 3

PluginDynamicLibraryMethod · 0.85
loadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected