2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_NSTIME_EXTERNS_H
|
|
|
|
#define JEMALLOC_INTERNAL_NSTIME_EXTERNS_H
|
2016-02-22 03:25:02 +08:00
|
|
|
|
|
|
|
void nstime_init(nstime_t *time, uint64_t ns);
|
|
|
|
void nstime_init2(nstime_t *time, uint64_t sec, uint64_t nsec);
|
|
|
|
uint64_t nstime_ns(const nstime_t *time);
|
|
|
|
uint64_t nstime_sec(const nstime_t *time);
|
2017-03-04 11:58:43 +08:00
|
|
|
uint64_t nstime_msec(const nstime_t *time);
|
2016-02-22 03:25:02 +08:00
|
|
|
uint64_t nstime_nsec(const nstime_t *time);
|
|
|
|
void nstime_copy(nstime_t *time, const nstime_t *source);
|
|
|
|
int nstime_compare(const nstime_t *a, const nstime_t *b);
|
|
|
|
void nstime_add(nstime_t *time, const nstime_t *addend);
|
|
|
|
void nstime_subtract(nstime_t *time, const nstime_t *subtrahend);
|
|
|
|
void nstime_imultiply(nstime_t *time, uint64_t multiplier);
|
|
|
|
void nstime_idivide(nstime_t *time, uint64_t divisor);
|
|
|
|
uint64_t nstime_divide(const nstime_t *time, const nstime_t *divisor);
|
|
|
|
#ifdef JEMALLOC_JET
|
2016-10-11 13:15:10 +08:00
|
|
|
typedef bool (nstime_monotonic_t)(void);
|
|
|
|
extern nstime_monotonic_t *nstime_monotonic;
|
2016-02-22 03:25:02 +08:00
|
|
|
typedef bool (nstime_update_t)(nstime_t *);
|
|
|
|
extern nstime_update_t *nstime_update;
|
|
|
|
#else
|
2016-10-11 13:15:10 +08:00
|
|
|
bool nstime_monotonic(void);
|
2016-02-22 03:25:02 +08:00
|
|
|
bool nstime_update(nstime_t *time);
|
|
|
|
#endif
|
|
|
|
|
2017-01-11 10:06:31 +08:00
|
|
|
#endif /* JEMALLOC_INTERNAL_NSTIME_EXTERNS_H */
|