Skip to content

Commit 92172c6

Browse files
committed
Make it clear how long it takes for asynchronous callbacks to reply
1 parent 0a70769 commit 92172c6

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module
3838
<!-- Start of generated documentation -->
3939

4040
The documentation of the 92 functions below was extracted from
41-
19 Vim scripts on June 30, 2014 at 02:45.
41+
19 Vim scripts on June 30, 2014 at 02:47.
4242

4343
### Asynchronous Vim script evaluation
4444

autoload/xolox/misc/async.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Asynchronous Vim script evaluation.
22
"
33
" Author: Peter Odding <[email protected]>
4-
" Last Change: June 22, 2014
4+
" Last Change: June 30, 2014
55
" URL: http://peterodding.com/code/vim/misc/
66
"
77
" 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
144144
let g:xolox#misc#async#counter += 1
145145
let request = {'function': a:options['function']}
146146
let request['arguments'] = get(a:options, 'arguments', [])
147+
let request['starttime'] = xolox#misc#timer#start()
147148
let request['number'] = unique_number
148149
let callback = get(a:options, 'callback')
149150
if !empty(callback)
@@ -211,8 +212,8 @@ function! xolox#misc#async#callback_to_parent(response) " {{{1
211212
" enables more or less instant callbacks after running an asynchronous
212213
" function.
213214
let unique_number = a:response['number']
214-
call xolox#misc#msg#debug("vim-misc %s: Processing asynchronous callback #%i ..", g:xolox#easytags#version, unique_number)
215215
let request = g:xolox#misc#async#requests[unique_number]
216+
call xolox#misc#timer#stop("vim-misc %s: Processing asynchronous callback #%i after %s ..", g:xolox#easytags#version, unique_number, request['starttime'])
216217
call remove(g:xolox#misc#async#requests, unique_number)
217218
let callback = get(request, 'callback')
218219
if !empty(callback)

doc/misc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ from the source code of the miscellaneous scripts using the Python module
167167
'vimdoctool.py' included in vim-tools [5].
168168

169169
The documentation of the 92 functions below was extracted from 19 Vim scripts
170-
on June 30, 2014 at 02:45.
170+
on June 30, 2014 at 02:47.
171171

172172
-------------------------------------------------------------------------------
173173
*misc-asynchronous-vim-script-evaluation*

0 commit comments

Comments
 (0)