跳转到内容
标准库Zig 0.17.0官方原文
源码std/time.zig

第 1 行

std.time.epoch

别名

第 1 行

别名目标 std.time.epoch

std.time.ms_per_day

常量

第 24 行

std.time.ms_per_hour

常量

第 23 行

std.time.ms_per_min

常量

第 22 行

std.time.ms_per_s

常量

第 21 行

std.time.ms_per_week

常量

第 25 行

std.time.ns_per_day

常量

第 9 行

std.time.ns_per_hour

常量

第 8 行

std.time.ns_per_min

常量

第 7 行

std.time.ns_per_ms

常量

第 5 行

std.time.ns_per_s

常量

第 6 行

std.time.ns_per_us

常量

第 4 行

std.time.ns_per_week

常量

第 10 行

std.time.s_per_day

常量

第 30 行

std.time.s_per_hour

常量

第 29 行

std.time.s_per_min

常量

第 28 行

std.time.s_per_week

常量

第 31 行

std.time.us_per_day

常量

第 17 行

std.time.us_per_hour

常量

第 16 行

std.time.us_per_min

常量

第 15 行

std.time.us_per_ms

常量

第 13 行

std.time.us_per_s

常量

第 14 行

std.time.us_per_week

常量

第 18 行

源码

std/time.zig

pub const epoch = @import("time/epoch.zig");

// 纳秒的细分单位。
pub const ns_per_us = 1000;
pub const ns_per_ms = 1000 * ns_per_us;
pub const ns_per_s = 1000 * ns_per_ms;
pub const ns_per_min = 60 * ns_per_s;
pub const ns_per_hour = 60 * ns_per_min;
pub const ns_per_day = 24 * ns_per_hour;
pub const ns_per_week = 7 * ns_per_day;

// 微秒的细分单位。
pub const us_per_ms = 1000;
pub const us_per_s = 1000 * us_per_ms;
pub const us_per_min = 60 * us_per_s;
pub const us_per_hour = 60 * us_per_min;
pub const us_per_day = 24 * us_per_hour;
pub const us_per_week = 7 * us_per_day;

// 一毫秒的分度。
pub const ms_per_s = 1000;
pub const ms_per_min = 60 * ms_per_s;
pub const ms_per_hour = 60 * ms_per_min;
pub const ms_per_day = 24 * ms_per_hour;
pub const ms_per_week = 7 * ms_per_day;

// 一秒的分度。
pub const s_per_min = 60;
pub const s_per_hour = s_per_min * 60;
pub const s_per_day = s_per_hour * 24;
pub const s_per_week = s_per_day * 7;

test {
    _ = epoch;
}