globus_time.h - Online Linux Manual PageSection : 3
Updated : Tue Jan 26 2021
Source : Version 18.9
Note : globus_common

NAMEglobus_time.h − Time Types and Macros​.

SYNOPSIS
#include 'globus_types​.h'
#include <time​.h>

Macros#define GlobusTimeAbstimeSet(Abstime, Sec, USec)
#define GlobusTimeAbstimeGet(Abstime, Sec, USec)
#define GlobusTimeReltimeSet(Reltime, Sec, USec)
#define GlobusTimeAbstimeDiff(Reltime, T1, T2)
#define GlobusTimeReltimeToUSec(SlpInt, Reltime)
#define GlobusTimeReltimeToMilliSec(Milliseconds, Reltime)
#define GlobusTimeAbstimeInc(Abstime, Reltime)
#define GlobusTimeAbstimeGetCurrent(Abstime)
#define GlobusTimeAbstimeCopy(Dest, Src)
#define GlobusTimeReltimeCopy(Dest, Src)
#define GlobusTimeReltimeMultiply(Reltime, Factor)
#define GlobusTimeReltimeDivide(Reltime, Factor)

Functionsglobus_bool_t globus_time_has_expired (const globus_abstime_t *abstime)
globus_bool_t globus_time_abstime_is_infinity (const globus_abstime_t *abstime)
globus_bool_t globus_time_reltime_is_infinity (const globus_reltime_t *reltime)
int globus_abstime_cmp (const globus_abstime_t *abstime_1, const globus_abstime_t *abstime_2)
int globus_reltime_cmp (const globus_reltime_t *reltime_1, const globus_reltime_t *reltime_2)

Detailed DescriptionTime Types and Macros​.

Macro Definition Documentation

#define GlobusTimeAbstimeCopy(Dest, Src)Value: { (Dest)​.tv_sec = (Src)​.tv_sec; (Dest)​.tv_nsec = (Src)​.tv_nsec; }Copy the absolute time

#define GlobusTimeAbstimeDiff(Reltime, T1, T2)Value: { int __res = globus_abstime_cmp(&(T1), &(T2)); if(__res < 0) { (Reltime)​.tv_sec = (T2)​.tv_sec - (T1)​.tv_sec; (Reltime)​.tv_usec = (((T2)​.tv_nsec - (T1)​.tv_nsec) / 1000); if((Reltime)​.tv_usec < 0) { (Reltime)​.tv_sec--; (Reltime)​.tv_usec += 1000000; } } else if(__res > 0) { (Reltime)​.tv_sec = (T1)​.tv_sec - (T2)​.tv_sec; (Reltime)​.tv_usec = (((T1)​.tv_nsec - (T2)​.tv_nsec) / 1000); if((Reltime)​.tv_usec < 0) { (Reltime)​.tv_sec--; (Reltime)​.tv_usec += 1000000; } } else { (Reltime)​.tv_sec = 0; (Reltime)​.tv_usec = 0; } }Find the difference between the 2 absolute times​.

#define GlobusTimeAbstimeGet(Abstime, Sec, USec)Value: { Sec = (Abstime)​.tv_sec; USec = ((Abstime)​.tv_nsec / 1000); }Seperates abstime structure into its components,sec and usec​.

#define GlobusTimeAbstimeGetCurrent(Abstime)Value: { struct timeval __time; gettimeofday(&__time, GLOBUS_NULL); (Abstime)​.tv_sec = __time​.tv_sec; (Abstime)​.tv_nsec = (__time​.tv_usec * 1000); }Get the current time

#define GlobusTimeAbstimeInc(Abstime, Reltime)Value: { (Abstime)​.tv_nsec += ((Reltime)​.tv_usec * 1000); if((Abstime)​.tv_nsec >= 1000000000) { (Abstime)​.tv_sec++; (Abstime)​.tv_nsec -= 1000000000; } (Abstime)​.tv_sec += (Reltime)​.tv_sec; }Add reltime to abstime

#define GlobusTimeAbstimeSet(Abstime, Sec, USec)Value: { GlobusTimeAbstimeGetCurrent(Abstime); (Abstime)​.tv_nsec += (USec * 1000); if((Abstime)​.tv_nsec >= 1000000000) { (Abstime)​.tv_sec += ((Abstime)​.tv_nsec / 1000000000); (Abstime)​.tv_nsec = (Abstime)​.tv_nsec % 1000000000; } (Abstime)​.tv_sec += Sec; }Set the abstime structure to the sec and usec parameter values​.

#define GlobusTimeReltimeCopy(Dest, Src)Value: { (Dest)​.tv_sec = (Src)​.tv_sec; (Dest)​.tv_usec = (Src)​.tv_usec; }Copy the relative time

#define GlobusTimeReltimeDivide(Reltime, Factor)Value: { (Reltime)​.tv_usec /= Factor; (Reltime)​.tv_sec /= Factor; }divide the reltime by factor

#define GlobusTimeReltimeMultiply(Reltime, Factor)Value: { (Reltime)​.tv_usec *= Factor; (Reltime)​.tv_sec *= Factor; if((Reltime)​.tv_usec >= 1000000) { (Reltime)​.tv_sec += ((Reltime)​.tv_usec / 1000000); (Reltime)​.tv_usec = (Reltime)​.tv_usec % 1000000; } }Multiple the reltime by factor

#define GlobusTimeReltimeSet(Reltime, Sec, USec)Value: { (Reltime)​.tv_usec = (USec); (Reltime)​.tv_sec = Sec; if((Reltime)​.tv_usec >= 1000000) { (Reltime)​.tv_sec += ((Reltime)​.tv_usec / 1000000); (Reltime)​.tv_usec = (Reltime)​.tv_usec % 1000000; } }Set the reltime structure to the sec and usec parameter values​.

#define GlobusTimeReltimeToMilliSec(Milliseconds, Reltime)Value: { Milliseconds = ((Reltime)​.tv_sec * 1000) + ((Reltime)​.tv_usec)/ 1000; }Convert a relative time into a long in millisec units

#define GlobusTimeReltimeToUSec(SlpInt, Reltime)Value: { SlpInt = ((Reltime)​.tv_sec * 1000000) + ((Reltime)​.tv_usec); }Convert a relitive time into a long in usec units

Function Documentation

int globus_abstime_cmp (const globus_abstime_t * abstime_1, const globus_abstime_t * abstime_2)Compare two absolute times​. This function returns an integer that reflects the comparison of two abstimes in the following way​. 0 : values are the same​. -1 : the first value is less than the second​. 1 : the first value is greater than the second​.

int globus_reltime_cmp (const globus_reltime_t * reltime_1, const globus_reltime_t * reltime_2)Compare two absolute times​. This function returns an integer that reflects the comparison of two reltimes in the following way​. 0 : values are the same​. -1 : the first value is less than the second​. 1 : the first value is greater than the second​.

globus_bool_t globus_time_abstime_is_infinity (const globus_abstime_t * abstime)Returns a boolean that reflects whether or not abstime is infinity​.

globus_bool_t globus_time_has_expired (const globus_abstime_t * abstime)Has abstime expired Returns a boolean that reflects whether or not abstime is less than the current time​.

globus_bool_t globus_time_reltime_is_infinity (const globus_reltime_t * reltime)Returns a boolean that reflects whether or not reltime is infinity​.

AuthorGenerated automatically by Doxygen for globus_common from the source code​.
0
Johanes Gumabo
Data Size   :   32,278 byte
man-GlobusTimeAbstimeSet.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 165,522
Visitor ID   :     :  
Visitor IP   :   18.226.187.224   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.