fork download
  1. command! -bar TimerStart let start_time = reltime()
  2. command! -bar TimerEnd echo reltimestr(reltime(start_time)) | unlet start_time
  3.  
  4. function! s:main()
  5. TimerStart
  6. for i in range(1000)
  7. let list = range(10000)
  8. unlet! list[0 : -1]
  9. endfor
  10. TimerEnd
  11. " => 1.062654
  12.  
  13. TimerStart
  14. for i in range(1000)
  15. let list = range(10000)
  16. unlet! list[0 : len(list)]
  17. endfor
  18. TimerEnd
  19. " => 1.023585
  20. endfunction
  21. call s:main()
  22.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty