Search code examples
datetimetimehaxehxcpp

How to get current time in milliseconds in Haxe?


I need a function that returns the local time in milliseconds on the CPP target.

I tried Haxe's Date class, but Date.now() gives me the time in seconds.


Solution

  • Sys.time() * 1000.0 - http://api.haxe.org/Sys.html#time

    Gives the most precise timestamp value (in seconds)

    To be clear, I tried this and got millisecond resolution on the cpp target. Sys is available on cpp, cs, java, macro, neko, php and python.