milliTimestamp
Get a calendar timestamp, in milliseconds, relative to UTC 1970-01-01.
Precision of timing depends on the hardware and operating system.
The return value is signed because it is possible to have a date that is
before the epoch.
See posix.clock_gettime for a POSIX timestamp.
Type definitions in this namespace
Types
Get a calendar timestamp, in seconds, relative to UTC 1970-01-01.
Functions
- timestamp
- Get a calendar timestamp, in seconds, relative to UTC 1970-01-01.
- milliTimestamp
- Get a calendar timestamp, in milliseconds, relative to UTC 1970-01-01.
- microTimestamp
- Get a calendar timestamp, in microseconds, relative to UTC 1970-01-01.
- nanoTimestamp
- Get a calendar timestamp, in nanoseconds, relative to UTC 1970-01-01.
= 1000
Values
- ns_per_us
- = 1000
- ns_per_ms
- = 1000 * ns_per_us
- ns_per_s
- = 1000 * ns_per_ms
- ns_per_min
- = 60 * ns_per_s
- ns_per_hour
- = 60 * ns_per_min
- ns_per_day
- = 24 * ns_per_hour
- ns_per_week
- = 7 * ns_per_day
- us_per_ms
- = 1000
- us_per_s
- = 1000 * us_per_ms
- us_per_min
- = 60 * us_per_s
- us_per_hour
- = 60 * us_per_min
- us_per_day
- = 24 * us_per_hour
- us_per_week
- = 7 * us_per_day
- ms_per_s
- = 1000
- ms_per_min
- = 60 * ms_per_s
- ms_per_hour
- = 60 * ms_per_min
- ms_per_day
- = 24 * ms_per_hour
- ms_per_week
- = 7 * ms_per_day
- s_per_min
- = 60
- s_per_hour
- = s_per_min * 60
- s_per_day
- = s_per_hour * 24
- s_per_week
- = s_per_day * 7
Source
Implementation
pub fn milliTimestamp() i64 {
return @as(i64, @intCast(@divFloor(nanoTimestamp(), ns_per_ms)));
}