mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Rename cgsleep_prepare_r as cgtimer_time to get time in cgtimer_t format and call cgsleep_prepare_r as a macro for cgtimer_time
This commit is contained in:
parent
deb7be72c6
commit
7d0c9b5060
4
util.c
4
util.c
@ -886,7 +886,7 @@ void timeraddspec(struct timespec *a, const struct timespec *b)
|
|||||||
/* These are cgminer specific sleep functions that use an absolute nanosecond
|
/* These are cgminer specific sleep functions that use an absolute nanosecond
|
||||||
* resolution timer to avoid poor usleep accuracy and overruns. */
|
* resolution timer to avoid poor usleep accuracy and overruns. */
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
void cgsleep_prepare_r(cgtimer_t *ts_start)
|
void cgtimer_time(cgtimer_t *ts_start)
|
||||||
{
|
{
|
||||||
clock_gettime(CLOCK_MONOTONIC, ts_start);
|
clock_gettime(CLOCK_MONOTONIC, ts_start);
|
||||||
}
|
}
|
||||||
@ -922,7 +922,7 @@ void cgsleep_us_r(cgtimer_t *ts_start, int64_t us)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
void cgsleep_prepare_r(cgtimer_t *ts_start)
|
void cgtimer_time(cgtimer_t *ts_start)
|
||||||
{
|
{
|
||||||
cgtime(ts_start);
|
cgtime(ts_start);
|
||||||
}
|
}
|
||||||
|
3
util.h
3
util.h
@ -86,7 +86,8 @@ void ms_to_timespec(struct timespec *spec, int64_t ms);
|
|||||||
void timeraddspec(struct timespec *a, const struct timespec *b);
|
void timeraddspec(struct timespec *a, const struct timespec *b);
|
||||||
void cgsleep_ms(int ms);
|
void cgsleep_ms(int ms);
|
||||||
void cgsleep_us(int64_t us);
|
void cgsleep_us(int64_t us);
|
||||||
void cgsleep_prepare_r(cgtimer_t *ts_start);
|
void cgtimer_time(cgtimer_t *ts_start);
|
||||||
|
#define cgsleep_prepare_r(ts_start) cgtimer_time(ts_start)
|
||||||
void cgsleep_ms_r(cgtimer_t *ts_start, int ms);
|
void cgsleep_ms_r(cgtimer_t *ts_start, int ms);
|
||||||
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us);
|
void cgsleep_us_r(cgtimer_t *ts_start, int64_t us);
|
||||||
double us_tdiff(struct timeval *end, struct timeval *start);
|
double us_tdiff(struct timeval *end, struct timeval *start);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user