Idris2/support/js/support_system_clock.js
Zoe Stafford ae2d4efc17 add javascript support to System.Clock
This may behave incorrectly when used with web workers
2022-12-22 11:47:44 +00:00

12 lines
458 B
JavaScript

const support_system_clock_process_start_time = performance.now();
function support_system_clock_clockTimeProcess() {
return performance.now() - support_system_clock_process_start_time
}
function support_system_clock_clockTimeThread() {
// The JS backend currently doesn't support threads
// This may be possible with the WebWorkers api, if so change this implementation
return performance.now() - support_system_clock_process_start_time
}