MySQL 8.0.39
Source Code Documentation
My_xp_util Class Reference

Class where cross platform utilities reside as static methods. More...

#include <my_xp_util.h>

Static Public Member Functions

static void sleep_seconds (unsigned int seconds)
 Current thread sleeps for the parameterized number of seconds. More...
 
static uint64_t getsystime (void)
 Get the system's time. More...
 
static void set_timespec_nsec (struct timespec *abstime, uint64_t nsec)
 Set the value of the timespec struct equal to the argument in nanoseconds. More...
 
static void set_timespec (struct timespec *abstime, uint64_t sec)
 Set the value of the timespec struct equal to the argument in seconds. More...
 
static int cmp_timespec (struct timespec *ts1, struct timespec *ts2)
 Compare two timespec structs. More...
 
static uint64_t diff_timespec (struct timespec *ts1, struct timespec *ts2)
 Diff two timespec structs. More...
 

Detailed Description

Class where cross platform utilities reside as static methods.

Member Function Documentation

◆ cmp_timespec()

static int My_xp_util::cmp_timespec ( struct timespec *  ts1,
struct timespec *  ts2 
)
inlinestatic

Compare two timespec structs.

Return values
1If ts1 ends after ts2.
-1If ts1 ends before ts2.
0If ts1 is equal to ts2.

◆ diff_timespec()

static uint64_t My_xp_util::diff_timespec ( struct timespec *  ts1,
struct timespec *  ts2 
)
inlinestatic

Diff two timespec structs.

ts1 has to be larger than ts2, otherwise it will return unexpected value.

Returns
difference between the two arguments.

◆ getsystime()

uint64_t My_xp_util::getsystime ( void  )
static

Get the system's time.

Returns
system's time in 100s of nanoseconds

◆ set_timespec()

static void My_xp_util::set_timespec ( struct timespec *  abstime,
uint64_t  sec 
)
inlinestatic

Set the value of the timespec struct equal to the argument in seconds.

◆ set_timespec_nsec()

static void My_xp_util::set_timespec_nsec ( struct timespec *  abstime,
uint64_t  nsec 
)
inlinestatic

Set the value of the timespec struct equal to the argument in nanoseconds.

◆ sleep_seconds()

void My_xp_util::sleep_seconds ( unsigned int  seconds)
static

Current thread sleeps for the parameterized number of seconds.

Parameters
secondsnumber of seconds for invoking thread to sleep

The documentation for this class was generated from the following files: