Skip to content
Browse files

Make it clear how long it takes for asynchronous callbacks to reply

  • Loading branch information...
1 parent 0a70769 commit 92172c683d92c19b8b75ae3c92d4bd8692a5c57c @xolox committed
Showing with 5 additions and 4 deletions.
  1. +1 −1 README.md
  2. +3 −2 autoload/xolox/misc/async.vim
  3. +1 −1 doc/misc.txt
View
2 README.md
@@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module
<!-- Start of generated documentation -->
The documentation of the 92 functions below was extracted from
-19 Vim scripts on June 30, 2014 at 02:45.
+19 Vim scripts on June 30, 2014 at 02:47.
### Asynchronous Vim script evaluation
View
5 autoload/xolox/misc/async.vim
@@ -1,7 +1,7 @@
" Asynchronous Vim script evaluation.
"
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: June 22, 2014
+" Last Change: June 30, 2014
" URL: http://peterodding.com/code/vim/misc/
"
" The `xolox#misc#async#call()` function builds on top of `xolox#misc#os#exec()`
@@ -144,6 +144,7 @@ function! xolox#misc#async#call(options) " {{{1
let g:xolox#misc#async#counter += 1
let request = {'function': a:options['function']}
let request['arguments'] = get(a:options, 'arguments', [])
+ let request['starttime'] = xolox#misc#timer#start()
let request['number'] = unique_number
let callback = get(a:options, 'callback')
if !empty(callback)
@@ -211,8 +212,8 @@ function! xolox#misc#async#callback_to_parent(response) " {{{1
" enables more or less instant callbacks after running an asynchronous
" function.
let unique_number = a:response['number']
- call xolox#misc#msg#debug("vim-misc %s: Processing asynchronous callback #%i ..", g:xolox#easytags#version, unique_number)
let request = g:xolox#misc#async#requests[unique_number]
+ call xolox#misc#timer#stop("vim-misc %s: Processing asynchronous callback #%i after %s ..", g:xolox#easytags#version, unique_number, request['starttime'])
call remove(g:xolox#misc#async#requests, unique_number)
let callback = get(request, 'callback')
if !empty(callback)
View
2 doc/misc.txt
@@ -167,7 +167,7 @@ from the source code of the miscellaneous scripts using the Python module
'vimdoctool.py' included in vim-tools [5].
The documentation of the 92 functions below was extracted from 19 Vim scripts
-on June 30, 2014 at 02:45.
+on June 30, 2014 at 02:47.
-------------------------------------------------------------------------------
*misc-asynchronous-vim-script-evaluation*

0 comments on commit 92172c6

Please sign in to comment.
Something went wrong with that request. Please try again.