Transcrypt icon indicating copy to clipboard operation
Transcrypt copied to clipboard

`time.monotonic` using `performance.now`?

Open mentalisttraceur opened this issue 6 years ago • 3 comments

Monotonic clocks are the best practice time source for any code that cares about how much time has passed between moments.

This looks like it would be trivial to add to the time module:

def monotonic():
    return performance.now() / 1000

Advantage of doing this in Transcrypt's library is that Python code already written to use or prefer time.monotonic will just work.

mentalisttraceur avatar Dec 11 '19 14:12 mentalisttraceur

If I don't hear a "no" maybe I'll just get a PR going once I have time to set up and test it, and we can discuss it in more depth then.

This one should be easier for me to get started on than the other change I suggested months ago.

mentalisttraceur avatar Dec 11 '19 14:12 mentalisttraceur

Sorry this issue has been without an answer for so long. A contribution to this regard is appreciated!

JdeH avatar Nov 02 '20 09:11 JdeH

@JdeH No problem! I've submitted pull request ~~#765~~ #787 with it now.

mentalisttraceur avatar Dec 19 '20 21:12 mentalisttraceur