forked from Imagelibrary/rtems
posix: Use one second based CLOCK_MONOTONIC
This simplifies the CLOCK_MONOTONIC based time services. It is potentially important for libbsd. Close #3265.
This commit is contained in:
@@ -40,16 +40,17 @@ int clock_gettime(
|
|||||||
_TOD_Get(tp);
|
_TOD_Get(tp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CLOCK_MONOTONIC
|
#ifdef CLOCK_MONOTONIC
|
||||||
if ( clock_id == CLOCK_MONOTONIC ) {
|
if ( clock_id == CLOCK_MONOTONIC ) {
|
||||||
_TOD_Get_zero_based_uptime_as_timespec( tp );
|
_Timecounter_Nanouptime( tp );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _POSIX_CPUTIME
|
#ifdef _POSIX_CPUTIME
|
||||||
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
|
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
|
||||||
_TOD_Get_zero_based_uptime_as_timespec( tp );
|
_Timecounter_Nanouptime( tp );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user