CLOCKTOTIME Convert Clock Vector to Epoch Time

Section: FreeMat Functions

Usage

Given the output of the clock command, this function computes the epoch time, i.e, the time in seconds since January 1,1970 at 00:00:00 UTC. This function is most useful for calculating elapsed times using the clock, and should be accurate to less than a millisecond (although the true accuracy depends on accuracy of the argument vector). The usage for clocktotime is
   y = clocktotime(x)

where x must be in the form of the output of clock, that is

   x = [year month day hour minute seconds]

Example

Here is an example of using clocktotime to time a delay of 1 second
--> x = clock

x = 

   1.0e+03 * 
    2.0090    0.0100    0.0040    0.0220    0.0260    0.0322 

--> sleep(1)
--> y = clock

y = 

   1.0e+03 * 
    2.0090    0.0100    0.0040    0.0220    0.0260    0.0332 

--> clocktotime(y) - clocktotime(x)

ans = 
    1.0010