Skip to content

Commit 2e4272e

Browse files
authored
Fix scaling factor for window.performance.now in WASM (#72)
1 parent 1595464 commit 2e4272e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1111
### Changed
1212

1313
- Fixed build issue on x86/x86_64 platforms that did not have SSE.
14+
- Fixed clock off by a factor of 1000 in wasm/web browser
1415

1516
## [0.10.0] - 2022-05-18
1617

src/clocks/monotonic/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl Monotonic {
1313
.expect(WASM_MISSING_WINDOW_PERF)
1414
.now();
1515
// `window.performance.now()` returns the time in milliseconds.
16-
return f64::trunc(now * 1000.0) as u64;
16+
return f64::trunc(now * 1_000_000.0) as u64;
1717
}
1818
}
1919

0 commit comments

Comments
 (0)