Skip to content

Deprication of now/0 and time precision issue in windows #45

@c-bik

Description

@c-bik

In windows erlang uses GetSystemTime to get current system time:

> erlang:system_info(os_system_time_source).                                                                          
[{function,'GetSystemTime'},
 {resolution,100},
 {parallel,yes},
 {time,1482414054673408}]

This has the following limitation
   Remarks
   The resolution of the GetTickCount function is limited to the resolution of the system timer,
   which is typically in the range of 10 milliseconds to 16 milliseconds. The resolution of the
   GetTickCount function is not affected by adjustments made by the GetSystemTimeAdjustment
   function.

As an alternative, GetSystemTimePreciseAsFileTime can be used for Windows (NIF), which gives:
   The GetSystemTimePreciseAsFileTime function retrieves the current
   system date and time with the highest possible level of precision (<1us).
   The retrieved information is in Coordinated Universal Time (UTC) format.

Current Resolution : 10 millisecond

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions