.
This commit is contained in:
@@ -1,7 +1,31 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use gpui::*;
|
||||
use ui::Root;
|
||||
use universal_time::{Instant, MonotonicClock, SystemTime, WallClock, define_time_provider};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
struct CustomTimeProvider;
|
||||
|
||||
impl WallClock for CustomTimeProvider {
|
||||
fn system_time(&self) -> SystemTime {
|
||||
SystemTime::from_unix_duration(Duration::from_secs(0))
|
||||
}
|
||||
}
|
||||
|
||||
impl MonotonicClock for CustomTimeProvider {
|
||||
fn instant(&self) -> Instant {
|
||||
Instant::from_ticks(Duration::from_secs(0))
|
||||
}
|
||||
}
|
||||
|
||||
define_time_provider!(CustomTimeProvider);
|
||||
|
||||
fn main() {
|
||||
// Binary entry point — actual initialization happens in `run()` below,
|
||||
// which is called explicitly from JavaScript after the WASM module loads.
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn run() -> Result<(), JsValue> {
|
||||
console_error_panic_hook::set_once();
|
||||
Reference in New Issue
Block a user