devalang_wasm/shared/debugger/
mod.rs

1/// Debugger utilities - logging and introspection
2use std::time::Instant;
3
4pub struct DebugTimer {
5    start: Instant,
6    label: String,
7}
8
9impl DebugTimer {
10    pub fn new(label: impl Into<String>) -> Self {
11        Self {
12            start: Instant::now(),
13            label: label.into(),
14        }
15    }
16
17    pub fn elapsed_ms(&self) -> f64 {
18        self.start.elapsed().as_secs_f64() * 1000.0
19    }
20
21    pub fn log_elapsed(&self) {}
22}
23
24impl Drop for DebugTimer {
25    fn drop(&mut self) {
26        self.log_elapsed();
27    }
28}
29
30#[cfg(test)]
31#[path = "test_shared_debugger.rs"]
32mod tests;