summaryrefslogtreecommitdiff
path: root/cli/ops/timers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops/timers.rs')
-rw-r--r--cli/ops/timers.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/ops/timers.rs b/cli/ops/timers.rs
index 7223633f8..21d1eda24 100644
--- a/cli/ops/timers.rs
+++ b/cli/ops/timers.rs
@@ -66,11 +66,12 @@ fn op_now(
let seconds = state.start_time.elapsed().as_secs();
let mut subsec_nanos = state.start_time.elapsed().subsec_nanos();
let reduced_time_precision = 2_000_000; // 2ms in nanoseconds
+ let permissions = state.permissions.lock().unwrap();
// If the permission is not enabled
// Round the nano result on 2 milliseconds
// see: https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp#Reduced_time_precision
- if !state.permissions.allow_hrtime.is_allow() {
+ if !permissions.allow_hrtime.is_allow() {
subsec_nanos -= subsec_nanos % reduced_time_precision
}