summaryrefslogtreecommitdiff
path: root/candle-wasm-examples/whisper/src/lib.rs
blob: f18320120291e257681a16dc753603b69e243850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pub const WITH_TIMER: bool = true;

struct Timer {
    label: &'static str,
}

// impl Timer {
//     fn new(label: &'static str) -> Self {
//         if WITH_TIMER {
//             web_sys::console::time_with_label(label);
//         }
//         Self { label }
//     }
// }

impl Drop for Timer {
    fn drop(&mut self) {
        if WITH_TIMER {
            web_sys::console::time_end_with_label(self.label)
        }
    }
}

mod app;
mod audio;
pub mod languages;
pub mod worker;
pub use app::App;
pub use worker::Worker;