Skip to content

How to use Benchmark class #133

Closed Locked Answered by czheo
mahmoudajawad asked this question in Q&A
Discussion options

You must be logged in to vote
from Benchmark import Benchmark

fn bench() -> Int:
    fn _iter():
        for i in range(10000):
            pass

    return Benchmark().run[_iter]()

print(bench())

This compiles but always return 0 in the playground.

Also checkout this: #21

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mahmoudajawad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants