{"id":57897,"library":"wasm-timer","title":"WASM Timer","description":"Abstraction over std::time::Instant and futures-timer that works on WASM.","status":"active","version":"0.2.5","language":"rust","source_language":null,"source_url":"https://github.com/tomaka/wasm-timer","tags":["wasm","timer","time","async","webassembly"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nwasm-timer = \"0.2.5\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add wasm-timer","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Instant","correct":"use wasm_timer::Instant;"}],"quickstart":{"code":"use wasm_timer::Instant;\nuse std::thread::sleep;\nuse std::time::Duration;\n\nfn main() {\n    let start = Instant::now();\n    sleep(Duration::from_secs(1));\n    let elapsed = start.elapsed();\n    println!(\"Elapsed: {:?}\", elapsed);\n}","lang":"rust","description":"Measures elapsed time using WASM-compatible Instant."},"warnings":[{"fix":"Use wasm-pack and ensure running in browser or Node.js with appropriate polyfills","message":"On WASM, requires wasm-bindgen and a browser environment","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'abstract':3 'async':19 'futur':10 'futures-tim':9 'instant':7 'std':5 'time':6,18 'timer':2,11,17 'wasm':1,15,16 'webassembl':20 'work':13","created_at":"2026-06-16T16:03:58.319224+00:00","updated_at":"2026-06-16T16:03:58.319224+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/tomaka/wasm-timer","github":"https://github.com/tomaka/wasm-timer","docs":"https://docs.rs/wasm-timer/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["async"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}