repo.or.cz
/
cl-zmq.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Forgot to add changes in prevois commit.
[cl-zmq.git]
/
perf
/
helpers.lisp
blob
cccb783c092bb81fd7df3560614774a8f7ec5045
1
(
asdf
:
oos
'
asdf
:
load-op
:
iolib.syscalls
)
2
3
(
defmacro
with-stopwatch
(&
body body
)
4
(
let
((
sec0
(
gensym
))
5
(
sec1
(
gensym
))
6
(
usec0
(
gensym
))
7
(
usec1
(
gensym
)))
8
`(
multiple-value-bind
(,
sec0
,
usec0
)
9
(
isys
:
gettimeofday
)
10
(
unwind-protect
11
(
progn
,@
body
))
12
(
multiple-value-bind
(,
sec1
,
usec1
)
13
(
isys
:
gettimeofday
)
14
(+ (*
1
e6
(
-
,
sec1
,
sec0
))
15
,
usec1
(
-
,
usec0
))))))