[lib] Do not round to ms precision anymore

Delete owl_timestamp_round_to_ms(), we now keep nanosecond precision.
This commit is contained in:
Matteo Cypriani 2011-03-15 13:48:16 +01:00
parent 3815ccae8b
commit d0b15bf978
2 changed files with 4 additions and 26 deletions

View File

@ -91,20 +91,10 @@ uint_fast8_t owl_frequency_to_channel(uint_fast16_t channel)
/*
* Set the TIMESTAMP 'now' at the current time (millisecond-precision).
* Sets the TIMESTAMP 'now' at the current time.
* Returns 0 in case of success non-zero otherwise.
*/
void owl_timestamp_now(TIMESTAMP *now)
{
if (! owl_timestamp_now_ns(now))
owl_timestamp_round_to_ms(now) ;
}
/*
* Set the TIMESTAMP 'now' at the current time (nanosecond-precision).
*/
int owl_timestamp_now_ns(TIMESTAMP *now)
int owl_timestamp_now(TIMESTAMP *now)
{
int ret ;
struct timespec now_ts ;
@ -121,16 +111,6 @@ int owl_timestamp_now_ns(TIMESTAMP *now)
/*
* Lower the precision of 'now' to milliseconds.
*/
void owl_timestamp_round_to_ms(TIMESTAMP *now)
{
now->tv_nsec = now->tv_nsec / 1000000u * 1000000u ;
}
/*
* Returns a TIMESTAMP from a struct timespec.
*/

View File

@ -227,9 +227,7 @@ BOOL owl_mac_equals(uint8_t *mac1, uint8_t *mac2) ;
uint_fast8_t owl_frequency_to_channel(uint_fast16_t channel) ;
// Time
void owl_timestamp_now(TIMESTAMP *now) ;
int owl_timestamp_now_ns(TIMESTAMP *now) ;
void owl_timestamp_round_to_ms(TIMESTAMP *now) ;
int owl_timestamp_now(TIMESTAMP *now) ;
TIMESTAMP owl_timespec_to_timestamp(const struct timespec d) ;
TIMESTAMP owl_timeval_to_timestamp(const struct timeval d) ;
uint64_t owl_timestamp_to_ms(TIMESTAMP date) ;