Files
candle/candle-wasm-example/src/lib.rs
2023-07-15 09:16:15 +01:00

32 lines
513 B
Rust

#![allow(dead_code)]
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;
mod model;
mod worker;
pub use app::App;
pub use worker::Worker;