goja_nodejs icon indicating copy to clipboard operation
goja_nodejs copied to clipboard

add process.hrtime

Open nichady opened this issue 2 years ago • 1 comments

nichady avatar Jun 08 '23 08:06 nichady

Thanks for the submission.

process.hrtime is supposed to work with monotonic clock. In Go there is no direct access to monotonic clock, it's hidden in time.Time returned by time.Now() and then used when calculating difference between two such values.

However, you can try using a similar approach as here: https://github.com/juju/clock/blob/master/monotonic/monotonic.go

dop251 avatar Jun 12 '23 21:06 dop251