Expand description
该库用于获取时间,不受系统修改时间的影响 采用进程启动时记录启动时间(对齐到秒),然后获取时间时,返回启动后的时间+启动时间 时刻在创建时始终保证不小于任何先前测量的时刻,并且通常对测量基准或计时操作所需时间等任务很有用。 但是请注意,不能保证瞬间是稳定的。换句话说,底层时钟的每个滴答声的长度可能不同(例如,某些秒可能比其他秒长)。一个瞬间可能会向前跳跃或经历时间膨胀(减速或加速),但它永远不会倒退。
Re-exports§
Modules§
- coarse_
now - Get instant value in nanosecond unit as fast as possible but less precise.
- instant
- minstant
- tsc_now
- This module will be compiled when it’s either linux_x86 or linux_x86_64.
Functions§
- now_
microsecond - 获取当前本地时间的微秒数
- now_
millisecond - 获取当前本地时间的毫秒数
- now_
nanosecond - 获取当前本地时间的纳秒数
- now_
second - 获取当前本地时间的秒数
- run_
micros - 启动后运行的微秒数
- run_
millis - 启动后运行的毫秒数
- run_
nanos - 启动后运行的纳秒数
- run_
second - 启动后运行的秒数
- start_
secs - 当前进程的启动时间,单位:秒