Skip to content

Commit

Permalink
Add h$getMonotonicNSec()
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed May 8, 2024
1 parent 855bc60 commit 931832e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jsbits/emscripten/crypto-wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,9 @@ if(typeof __dirname == 'undefined') {
function h$foundation_sysrandom_linux(buf_d, buf_o, size) {
cryptoObj.getRandomValues(typedArray);
}

function h$getMonotonicNSec() {
var t = BigInt((new Date()).getTime())*1000n;
h$ret1 = Number(t&0xffffffffn);
return Number((t>>32n)&0xffffffffn);
}

0 comments on commit 931832e

Please sign in to comment.