Skip to content

Support benchmark of async calls #3

Description

@gitmalong

        benchmark
            .add(
                new Test('Sleep', async() => {
                    await sleep(10000)
                }))


        const results: Array<[string, Stats]> = await benchmark.run();
        for (let result of results) {
            console.log("Test name: " + result[0])
            console.log("Test stats: ")
            console.log(result[1])
        }

This code prints the results before the sleep promise was resolved. How to use benchmark with async calls?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions