mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-27 01:22:21 +00:00
util/time: Move NSEC_PER_SEC to header
This constant can be useful whenever one has to deal with timespecs, so let's move it to the header.
This commit is contained in:
parent
d6b47c3ab0
commit
0d728f96b7
@ -4,6 +4,8 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
static const long NSEC_PER_SEC = 1000000000;
|
||||
|
||||
/**
|
||||
* Get the current time, in milliseconds.
|
||||
*/
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#include "util/time.h"
|
||||
|
||||
static const long NSEC_PER_SEC = 1000000000;
|
||||
|
||||
int64_t timespec_to_msec(const struct timespec *a) {
|
||||
return (int64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user