Announcement

Collapse
No announcement yet.

s.dyn_tm_usec Microseconds or Miliseconds? Is this a bug?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    s.dyn_tm_usec Microseconds or Miliseconds? Is this a bug?

    The values for s.dyn_tm_usec returned by Windows Mia appears to be in millisecond with 3 digits of precision. I understand that Windows Time of Day clock ticks only occur every 55 milliseconds (18.2 times per second)

    On Linux the system returns up to a 6 digit number and the clock ticks every 16 microseconds or so.

    The half mark second for s.dyn_tm_usec on Linux is 500000 on Windows it is 500.

    The documentation for dyn_tm_usec says, "The current microsecond, relative to dyn_tm_sec or tm_sec. (On Windows, this value is updated only in 50-millisecond increments)."

    My problem is that the change in precision screws up the math.

    Shouldn't Mia also return 500000, In other words shouldn't the value be multiplied by 1000 before it's returned?

    To be clear, I'm not complaing about timing precision (that's OS dependant) but the numeric precision of the value returned.
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    #2
    Re: s.dyn_tm_usec Microseconds or Miliseconds? Is this a bug?

    It's a bug.

    Looking at the source code there was a change made in 2003 that unintentionally switched Win32 systems (IIS and Mia) from microseconds with the behavior that you described above to milliseconds. I'm not sure exactly what the justification was but I suspect the change was unintentional.

    I'll file a bug and we'll fix this in the next release. I don't know offhand what the resolution of the value will be but the units will be microseconds, as expected.

    Comment


      #3
      Re: s.dyn_tm_usec Microseconds or Miliseconds? Is this a bug?

      Thanks Jon,

      It was driving me nuts until I tested my function on Linux.
      Ray Yates
      "If I have seen further, it is by standing on the shoulders of giants."
      --- Sir Isaac Newton

      Comment

      Working...
      X