Mon Oct 18, 2021 7:57 am
Login Register Lost Password? Contact Us

time with milliseconds

Questions around writing code and queries

Wed Jul 13, 2011 8:05 pm Change Time Zone

Hello! I see there is an attribute (ut.getTime()) which returns hrs/mins/secs. Is there an existing attribute which will return milliseconds?
Posts: 5
Joined: Fri May 13, 2011 8:10 pm

Thu Jul 14, 2011 9:59 am Change Time Zone

import std.system.debug;


Beware that definitions aren't assignments, and because the function isn't pure it will tend to be re-evaluated each time it is used. This can lead to some confusing results if you're not careful. E.g.,

startTime := debug.msTick();
Will typically output 0. startTime is evaluated at the same time as debug.msTick()!

Assigning startTime into a row, or using independent e.g.,

startTime := debug.msTick() : independent;

are some ways of avoiding this.

You need to be careful about when the expression is evaluated.
Community Advisory Board Member
Community Advisory Board Member
Posts: 198
Joined: Wed May 18, 2011 9:48 am

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest