MCPcopy Create free account
hub / github.com/Botloader/botloader / elapsed_millis

Function elapsed_millis

components/scheduler/src/dispatch_metrics.rs:37–43  ·  view source on GitHub ↗

Fractional milliseconds since `since`; the early hops are normally sub-millisecond so whole-ms resolution would round them all to zero.

(since: DateTime<Utc>)

Source from the content-addressed store, hash-verified

35/// Fractional milliseconds since `since`; the early hops are normally
36/// sub-millisecond so whole-ms resolution would round them all to zero.
37pub(crate) fn elapsed_millis(since: DateTime<Utc>) -> f64 {
38 let elapsed = Utc::now().signed_duration_since(since);
39 elapsed
40 .num_microseconds()
41 .map(|us| us as f64 / 1000.0)
42 .unwrap_or_else(|| elapsed.num_milliseconds() as f64)
43}
44
45pub(crate) fn event_source_label(source: EventSource) -> &'static str {
46 match source {

Callers 2

handle_worker_msgMethod · 0.85
record_stageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected