ckb-systemtime 1.1.0

ckb_systemtime provide real system timestamp, and faketime when `enable_faketime` feature is enabled
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(not(feature = "enable_faketime"))]
#[cfg(test)]
mod tests_realtime {
    use crate::{system_time_as_millis, unix_time_as_millis};

    #[test]
    fn test_get_system_real_timestamp() {
        assert!(cfg!(not(feature = "enable_faketime")));

        let now = system_time_as_millis();
        assert!(unix_time_as_millis() >= now);
    }
}