diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-04-02 09:31:17 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-02 10:45:43 -0700 |
| commit | cb0882de1979522b2fc3dc4c3064b0ad21d50b06 (patch) | |
| tree | f7469680d2cddd98eeea1955d934555ca1d4347b /reftable/system.c | |
| parent | aa8938573050e6ab44a46e3b9f26c0e442f835aa (diff) | |
| download | git-cb0882de1979522b2fc3dc4c3064b0ad21d50b06.tar.xz | |
reftable/system: add abstraction to retrieve time in milliseconds
We directly call gettimeofday(3p), which may not be available on some
platforms. Provide the infrastructure to let projects easily use their
own implementations of this function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/system.c')
| -rw-r--r-- | reftable/system.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/reftable/system.c b/reftable/system.c index 4d7e366b55..cd76e56be8 100644 --- a/reftable/system.c +++ b/reftable/system.c @@ -4,6 +4,7 @@ #include "basics.h" #include "reftable-error.h" #include "../lockfile.h" +#include "../trace.h" #include "../tempfile.h" #include "../write-or-die.h" @@ -137,3 +138,8 @@ int reftable_fsync(int fd) { return fsync_component(FSYNC_COMPONENT_REFERENCE, fd); } + +uint64_t reftable_time_ms(void) +{ + return getnanotime() / 1000000; +} |
