patch 9.0.1411: accuracy of profiling is not optimal
Problem: Accuracy of profiling is not optimal. Solution: Use CLOCK_MONOTONIC if possible. (Ernie Rael, closes #12129)
This commit is contained in:
committed by
Bram Moolenaar
parent
16110ccf11
commit
076de79ad8
@ -1148,9 +1148,10 @@ long you take to respond to the input() prompt is irrelevant.
|
||||
Profiling should give a good indication of where time is spent, but keep in
|
||||
mind there are various things that may clobber the results:
|
||||
|
||||
- The accuracy of the time measured depends on the gettimeofday() system
|
||||
function. It may only be as accurate as 1/100 second, even though the times
|
||||
are displayed in micro seconds.
|
||||
- The accuracy of the time measured depends on the gettimeofday(), or
|
||||
clock_gettime if available, system function. The accuracy ranges from 1/100
|
||||
second to nano seconds. With clock_gettime the times are displayed in nano
|
||||
seconds, otherwise micro seconds. You can use `has("prof_nsec")`.
|
||||
|
||||
- Real elapsed time is measured, if other processes are busy they may cause
|
||||
delays at unpredictable moments. You may want to run the profiling several
|
||||
|
||||
Reference in New Issue
Block a user