diff options
author | Ernie Rael <errael@raelity.com> | 2023-03-16 21:43:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-03-16 21:43:15 +0000 |
commit | 076de79ad832558267b3ff903c048df2f4c1a5d6 (patch) | |
tree | e0412a99ca8e44db8702b98a6a1cec93a0c561b9 /src/evalfunc.c | |
parent | 16110ccf11de7a41cb0db0ae1ecb829e5a1b98fc (diff) |
patch 9.0.1411: accuracy of profiling is not optimalv9.0.1411
Problem: Accuracy of profiling is not optimal.
Solution: Use CLOCK_MONOTONIC if possible. (Ernie Rael, closes #12129)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 0f266dceed..29206b9a34 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6145,6 +6145,13 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, + {"prof_nsec", +#ifdef HAVE_TIMER_CREATE + 1 +#else + 0 +#endif + }, {"reltime", #ifdef FEAT_RELTIME 1 @@ -8226,7 +8233,7 @@ init_srand(UINT32_T *x) # if defined(MSWIN) *x = (UINT32_T)res.LowPart; # else - *x = (UINT32_T)res.tv_usec; + *x = (UINT32_T)res.tv_fsec; # endif #else *x = vim_time(); |