globus_time.h(3)

๐Ÿ“ฆ
version 18.15 ยท 6 versions
, in epel 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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