Current time in milliseconds ( javascript / cpp)?

What is the correct way to get time in milliseconds in Haxe ( for javascript / cpp platform) ?
I think Sys.time() * 1000 is more appropriate ( because is more accurate and can be compiled to cpp ) , but Sys.time is not supported for javascritpt ( HTML5) .
From other side will return per-second precision ( depends of target) .
Why Haxe not have one function which can return milliseconds for all targets ?

Try this: haxe.Timer - Haxe 4.2.1 API
It should work on all targets.

haxe.Timer.stamp() returns time in seconds, but with fraction (1531224658.135 for example), so you can multiply it by 1000 and get accurate milliseconds.