debug code to measure how long calls to system() take

This commit is contained in:
Bart Trojanowski 2009-11-20 15:42:18 -05:00
parent 71c9dbb71d
commit f3d3e74b97

View file

@ -658,8 +658,15 @@ endfunction
function! s:NM_run(args)
let cmd = g:notmuch_cmd . ' ' . join(a:args) . '< /dev/null'
let start = reltime()
let out = system(cmd)
if v:shell_error
let err = v:shell_error
let delta = reltime(start)
echo printf('[%s] {%s} %s', reltimestr(delta), string(err), string(cmd))
if err
echohl Error
echo substitute(out, '\n*$', '', '')
echohl None