ns_time - Perform various time-related functions
This command provides various time-related functions. Times might be of the form "sec" (integer value), "sec:usec" (NaviServer internal format) or "sec.fraction"
All time arguments can be specified in the form secs?:microsecs?, or secs.fraction, or as a number with a time unit. Valid time units are μs, ms, s, m, h, d, w, y.
Returns the seconds portion of the current time.
Adjusts time so that it is within the valid range of values for a time. (TODO: Figure out how this is actually useful.)
Computes the time difference between time1 to time2. It does this by subtracting time1 from time2 and returns a string in "sec:usec" format.
Returns the time in seconds in the form of a real number.
Returns the current time in "sec:usec" format.
Increments time by sec seconds and optionally usec microseconds. Returns a string in "sec:usec" format.
Returns a string in the form "sec:usec". usec defaults to zero. If usec is zero, the colon and usec are not returned. If sec is zero, however, it is returned as part of the time string.
Parses a time and returns the seconds portion.
Parses a time and returns the microseconds portion. It assumes zero microseconds if time only contains seconds.
% ns_time 1087006685
% ns_time get 1087013247:598897
% set t [ns_time diff $time $time3] 0:13 % ns_time format $t 0.000013