TutGetWallTimeStruct


Name

TutGetWallTimeStruct — get the current wall clock (computer) time as a time struct

Synopsis

T_BOOL TutGetWallTimeStruct(time_return) 
T_TIME_STRUCT *time_return; 

Arguments

time_return — pointer to location to store wall time

Return Values

TRUE if successful, FALSE otherwise.

Diagnostics

None

Description

TutGetWallTimeStruct is a convenience function that returns the current wall clock time into a T_TIME_STRUCT pointed to by the caller.

On UNIX, MVS, and Windows, TutGetWallTimeStruct calls gettimeofday (that fills in a timeval structure) and fills in the fields of the pointed to T_TIME_STRUCT. This value is the number of seconds and microseconds since midnight January 1, 1970 GMT.

On OpenVMS, TutGetWallTimeStruct calls ftime (that fills in a timeb_t structure) and fills in the fields of the provided T_TIME_STRUCT. This value is the number of seconds and microseconds since midnight, January 1, 1970 local time. (OpenVMS has no concept of time zones.)

Caution

TutGetWallTimeStruct does not return the current SmartSockets data time. Use TutGetCurrentTimeStruct for that.

See Also

TutGetCurrentTimeStruct, TutGetWallTime

Examples

This example gets the current wall clock time, and then prints out the time with a formatted print statement:

T_TIME_STRUCT time_struct; 
if (!TutGetWallTimeStruct(&time_struct)) { 
  TutOut("Could not get wall time\n"); 
  return; 
} 
TutOut("Raw wall clock time is %d.%06d.\n", 
        time_struct.sec, time_struct.usec); 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com