diff options
author | pommicket <pommicket@gmail.com> | 2022-12-23 14:55:24 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-23 14:55:24 -0500 |
commit | 214dae3a7b58077436ffd173ae9fe8f2a6d9b97b (patch) | |
tree | 3fda7c1f935eff6ce9e9f647e148296af725e819 /time.c | |
parent | dbab768e4d0be378e65399f32f26edb4756533ce (diff) |
wait before showing "Loading..." for autocomplete
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -38,7 +38,12 @@ static struct timespec timespec_max(struct timespec a, struct timespec b) { static double timespec_to_seconds(struct timespec ts) { return (double)ts.tv_sec - + (double)ts.tv_nsec * 0.000000001; + + (double)ts.tv_nsec * 1e-9; +} + +static double timespec_sub(struct timespec a, struct timespec b) { + return (double)(a.tv_sec - b.tv_sec) + + (double)(a.tv_nsec - b.tv_nsec) * 1e-9; } static struct timespec time_get(void) { |