UNPKG
test-performance
Version:
latest (1.1.3)
1.1.3
1.1.2
1.1.1
Simplifying testing performance
github.com/nickheal/test-performance
nickheal/test-performance
test-performance
/
src
/
perfTest.ts
10 lines
(9 loc)
•
243 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
/** * This runs a single performance test of a function */
export
default
async
function
perfTest
(
func:
Function
):
Promise
<number> {
const
start = performance.
now
();
await
func
();
const
end = performance.
now
();
return
end - start; }