TutGetCurrentTime get the current SmartSockets data time
None
Floating-point number containing current SmartSockets data time.
None
TutGetCurrentTime returns the current SmartSockets data time. Data time is the time contained in SmartSockets TIME messages. The interpretation of the current data time depends on the application. Normally, the data time has some relationship to the computer wall clock time, but this is not always the case.
TutGetCurrentTime does not return the current wall clock time; to get system time, use TutGetWallTime instead.
TutGetCurrentTime returns 0.00 unless you first explicitly set the time by calling TutSetCurrentTime(). TutGetCurrentTime is a legacy function for use with the SmartSockets Product Family (RTworks). Most SmartSockets programs instead use TutGetWallTime, which returns the current system time value.
TutGetWallTime, TutTimeNumToStr
This example looks up the time converter hms
, gets the current SmartSockets system time, and then converts the time to a string using the hms
converter:
T_TIME_CVT time_cvtr;
T_REAL8 system_time;
T_REAL8 wall_time;
wall_time = TutGetWallTime();
TutSetCurrentTime(wall_time);
system_time = TutGetCurrentTime();
TutOut("Raw system time is %f.\n", system_time);
time_cvtr = TutTimeCvtLookup("hms");
if (time_cvtr != NULL) {
T_STR *time_str;
if (TutTimeCvtNumToStr(time_cvtr, system_time, time_str)) {
TutOut("Formatted system time is %s\n", time_str);
}
}
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |