fix clock implementation for OPFS IO

This commit is contained in:
Nikita Sivukhin
2025-09-19 13:17:23 +04:00
parent bc2dbe9025
commit 7049f3ddae
6 changed files with 9 additions and 9 deletions

View File

@@ -140,7 +140,11 @@ impl Opfs {
impl Clock for Opfs {
fn now(&self) -> Instant {
Instant { secs: 0, micros: 0 } // TODO
let now = chrono::Local::now();
Instant {
secs: now.timestamp(),
micros: now.timestamp_subsec_micros(),
}
}
}

View File

@@ -12,8 +12,6 @@
#[cfg(feature = "browser")]
pub mod browser;
#[cfg(feature = "browser")]
use crate::browser::opfs;
use napi::bindgen_prelude::*;
use napi::{Env, Task};