Get milliseconds timestamps without system() calls for tests

This commit is contained in:
w0rp
2017-03-09 20:22:02 +00:00
parent ad49846a48
commit fc072a0772
2 changed files with 13 additions and 3 deletions

View File

@@ -134,3 +134,13 @@ function! ale#util#InSandbox() abort
return 0
endfunction
" Get the number of milliseconds since some vague, but consistent, point in
" the past.
"
" This function can be used for timing execution, etc.
"
" The time will be returned as a Number.
function! ale#util#ClockMilliseconds() abort
return float2nr(reltimefloat(reltime()) * 1000)
endfunction