ts_ 0.1.3

High-performance, lightweight time measurement library based on coarsetime. / 基于 coarsetime 的高性能轻量级时间测量库。
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "nano")]
pub fn nano() -> u64 {
  coarsetime::Clock::now_since_epoch().as_nanos()
}

#[cfg(feature = "sec")]
pub fn sec() -> u64 {
  coarsetime::Clock::now_since_epoch().as_secs()
}

#[cfg(feature = "milli")]
pub fn milli() -> u64 {
  coarsetime::Clock::now_since_epoch().as_millis()
}