MCPcopy Create free account
hub / github.com/aws/clock-bound / now

Method now

clock-bound/src/daemon/event.rs:51–60  ·  view source on GitHub ↗

Create a new [`SystemClockMeasurement`]

()

Source from the content-addressed store, hash-verified

49impl SystemClockMeasurement {
50 /// Create a new [`SystemClockMeasurement`]
51 pub fn now() -> Self {
52 let pre = read_timestamp_counter_begin();
53 let system_time = RealTime.get_time();
54 let post = read_timestamp_counter_end();
55 let tsc = pre.midpoint(post);
56 Self {
57 system_time,
58 tsc: TscCount::new(tsc.into()),
59 }
60 }
61}

Callers

nothing calls this directly

Calls 5

midpointMethod · 0.80
newFunction · 0.50
get_timeMethod · 0.45

Tested by

no test coverage detected