Mercury
Classes | Typedefs | Functions
mercury_time.h File Reference
#include "mercury_util_config.h"
Include dependency graph for mercury_time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hg_time
 

Typedefs

typedef struct hg_time hg_time_t
 

Functions

HG_UTIL_EXPORT int hg_time_get_current (hg_time_t *tv)
 Get an elapsed time on the calling processor. More...
 
HG_UTIL_EXPORT double hg_time_to_double (hg_time_t tv)
 Convert hg_time_t to double. More...
 
HG_UTIL_EXPORT hg_time_t hg_time_from_double (double d)
 Convert double to hg_time_t. More...
 
HG_UTIL_EXPORT int hg_time_less (hg_time_t in1, hg_time_t in2)
 Compare time values. More...
 
HG_UTIL_EXPORT hg_time_t hg_time_add (hg_time_t in1, hg_time_t in2)
 Add time values. More...
 
HG_UTIL_EXPORT hg_time_t hg_time_subtract (hg_time_t in1, hg_time_t in2)
 Subtract time values. More...
 
HG_UTIL_EXPORT int hg_time_sleep (const hg_time_t rqt, hg_time_t *rmt)
 Sleep until the time specified in rqt has elapsed. More...
 
HG_UTIL_EXPORT char * hg_time_stamp (void)
 Get a string containing current time/date stamp. More...
 

Typedef Documentation

typedef struct hg_time hg_time_t

Definition at line 16 of file mercury_time.h.

Function Documentation

HG_UTIL_EXPORT int hg_time_get_current ( hg_time_t tv)

Get an elapsed time on the calling processor.

Parameters
tv[OUT] pointer to returned time structure
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT double hg_time_to_double ( hg_time_t  tv)

Convert hg_time_t to double.

Parameters
tv[IN] time structure
Returns
Converted time in seconds
HG_UTIL_EXPORT hg_time_t hg_time_from_double ( double  d)

Convert double to hg_time_t.

Parameters
d[IN] time in seconds
Returns
Converted time structure
HG_UTIL_EXPORT int hg_time_less ( hg_time_t  in1,
hg_time_t  in2 
)

Compare time values.

Parameters
in1[IN] time structure
in2[IN] time structure
Returns
1 if in1 < in2, 0 otherwise
HG_UTIL_EXPORT hg_time_t hg_time_add ( hg_time_t  in1,
hg_time_t  in2 
)

Add time values.

Parameters
in1[IN] time structure
in2[IN] time structure
Returns
Summed time structure
HG_UTIL_EXPORT hg_time_t hg_time_subtract ( hg_time_t  in1,
hg_time_t  in2 
)

Subtract time values.

Parameters
in1[IN] time structure
in2[IN] time structure
Returns
Subtracted time structure
HG_UTIL_EXPORT int hg_time_sleep ( const hg_time_t  rqt,
hg_time_t rmt 
)

Sleep until the time specified in rqt has elapsed.

Parameters
reqt[IN] time structure
rmt[OUT] pointer to time structure
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT char* hg_time_stamp ( void  )

Get a string containing current time/date stamp.

Returns
Valid string or NULL on failure