Files
wasmeld/components/wasi-clock-probe/src/lib.rs
T

22 lines
482 B
Rust
Raw Normal View History

mod bindings {
wit_bindgen::generate!({
path: "wit",
world: "wasi-clock-probe-component",
});
}
struct WasiClockProbe;
impl bindings::Guest for WasiClockProbe {
fn init(_config: Vec<u8>) -> Result<(), bindings::ServiceError> {
Ok(())
}
fn invoke(input: Vec<u8>) -> Result<Vec<u8>, bindings::ServiceError> {
let _ = std::time::Instant::now();
Ok(input)
}
}
bindings::export!(WasiClockProbe with_types_in bindings);