src/timer.js
async function timeit(fun, context={}, args=[]) {
    const start = now();
    await fun.call(context, ...args);
    const end = now();

    return end - start;
}
async function timeit(fun, context={}, args=[]) {
    const start = now();
    await fun.call(context, ...args);
    const end = now();

    return end - start;
}
async function timeit ( fun , context = { } , args = [ ] ) { const start = now ( ) ; await fun . call ( context , ... args ) ; const end = now ( ) ; return end - start ; }
Measure tiem to execute a function.

wait for done if the target function returns a thenable object. so you can use async function.

NOTE: this function will execute target function only once.

@param {function(): ?Promise} fun - the target function.
@param {Object} [context={}] - the `this` for target function.
@param {Object[]} [args=[]] - arguments to passing to target function.

@return {Promise<Number>} milliseconds taked executing.

@example
const msec = await timeit(function() {
# do something heavy.
});

@example
console.log(await timeit(axios.get, args=['http://example.com']));

@since 0.2.4
Measure tiem to execute a function .