globus_time.h(3)
๐ globus_time.h ๐
okay bestie, welcome to the Library Functions Manual page for globus_time.h โ literally all the time types and macros you could ever want. clock in, babes, we're doing time math ๐ฐ๏ธโจ
๐ธ NAME ๐ธ
globus_time.h โ Time Types and Macros. periodt.
๐ 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)
๐ Functions ๐
globus_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 Description ๐
Time Types and Macros. that's the whole vibe, fr fr ๐ฆ
๐ง Macro Definition Documentation ๐ง
๐ #define GlobusTimeAbstimeCopy( Dest, Src)
Value:
{ \
(Dest).tv_sec = (Src).tv_sec; \
(Dest).tv_nsec = (Src).tv_nsec; \
}
Copy the absolute time. it's giving copy-paste but make it clock โฐ
๐ #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. math girlies rise ๐งฎ
๐ #define GlobusTimeAbstimeGet( Abstime, Sec, USec)
Value:
{ \
Sec = (Abstime).tv_sec; \
USec = ((Abstime).tv_nsec / 1000); \
}
Separates the abstime structure into its components, sec and usec. unboxing, but for time ๐ฆ
๐ #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. right now, bestie, this exact second ๐ซถ
๐ #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. plus-one, but make it temporal โ
๐ #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. glow-up for your timestamps โจ
๐ #define GlobusTimeReltimeCopy( Dest, Src)
Value:
{ \
(Dest).tv_sec = (Src).tv_sec; \
(Dest).tv_usec = (Src).tv_usec; \
}
Copy the relative time. twin behavior, but clocked ๐
๐ #define GlobusTimeReltimeDivide( Reltime, Factor)
Value:
{ \
(Reltime).tv_usec /= Factor; \
(Reltime).tv_sec /= Factor; \
}
divide the reltime by Factor. math is mathing ๐
๐ #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. yes the doc says "Multiple", we're keeping it, it's iconic ๐
๐ #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. no cap ๐งข
๐ #define GlobusTimeReltimeToMilliSec( Milliseconds, Reltime)
Value:
{ \
Milliseconds = ((Reltime).tv_sec * 1000) + \
((Reltime).tv_usec)/ 1000; \
}
Convert a relative time into a long in millisec units. ms girl era โฑ๏ธ
๐ #define GlobusTimeReltimeToUSec( SlpInt, Reltime)
Value:
{ \
SlpInt = ((Reltime).tv_sec * 1000000) + \
((Reltime).tv_usec); \
}
Convert a relitive time into a long in usec units. micro-girlie energy ๐ฌ
๐ 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 int 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 int 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 globus_bool_t that reflects whether or not abstime is infinity. to the moon and beyond, literally ๐
๐ globus_bool_t globus_time_has_expired (const globus_abstime_t * abstime)
Has abstime expired.
Returns a globus_bool_t that reflects whether or not abstime is less than the current time. rip to your deadline ๐
๐ globus_bool_t globus_time_reltime_is_infinity (const globus_reltime_t * reltime)
Returns a globus_bool_t that reflects whether or not reltime is infinity. infinite slay โพ๏ธ
๐ซถ Author ๐ซถ
Generated automatically by Doxygen for globus_common from the source code. (not a human, just vibes ๐ค)
okay that's the whole page bestie, mwah ๐ โ this was globus_common, Version 18.15, page globus_time.h(3), go clock something cute ๐๐
๐ฆ where this page comes from
- epel 10: globus-common-doc 18.15-1.el10_2 ยท Apache-2.0
- fedora 43: globus-common-doc 18.15-1.fc43 ยท Apache-2.0
- fedora 44: globus-common-doc 18.15-2.fc44 ยท Apache-2.0
- ubuntu resolute: libglobus-common-doc 18.15-1 ยท Apache-2.0
- ubuntu stonking: libglobus-common-doc 18.15-2 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms