UNPKG
timed-tape
Version:
latest (0.1.1)
0.1.1
0.1.0
Prints the time each tape test took
github.com/diasdavid/timed-tape
diasdavid/timed-tape
timed-tape
/
src
/
index.js
12 lines
(11 loc)
•
272 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
module
.
exports
=
function
(
tape
) {
return
function
(
) {
var
t = tape.
apply
(
this
,
arguments
)
var
start =
Date
.
now
() t.
on
(
'end'
,
function
(
) {
var
now =
Date
.
now
()
console
.
log
(
'# time: '
+
Math
.
round
(now - start) +
' ms'
) })
return
t } }