Time

Some basic utilities relating to time, date, and CPU time are provided.

public  Real  current_cpu_seconds( void )

Returns the number of CPU seconds used by the current process so far.

public  Real  current_realtime_seconds( void )

Returns the number of seconds that the current process has been running.

public  STRING  get_clock_time()

Returns a string representing the current clock time (hours and minutes), for which the caller is reponsible for deleting.

public  STRING  get_date()

Returns a string representing the current date, for which the caller is reponsible for deleting.

public  STRING  format_time(
    STRING   format,
    Real     seconds )

Takes a time in seconds and a format string which has format components, e.g. ``%g %s'', and prints the time into a string in appropriate units of milliseconds, seconds, minutes, days, etc. The string is returned and the calling program is responsible for deleting the string.

public  void  print_time(
    STRING   format,
    Real     seconds )

Same as format_time, but calls print() with the result.

public  void  sleep_program(
    Real seconds )

Suspends the program for the specified number of seconds. Note that on most systems, this will only be performed to the nearest multiple of some particular time increment. On Silicon Graphics Systems this will be to the nearest hundredth of a second.