mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Add simple benchmark runner.
This commit is contained in:
committed by
Christoffer Lerno
parent
79f964dce9
commit
efb492eace
29
resources/examples/benchmarks.c3
Normal file
29
resources/examples/benchmarks.c3
Normal file
@@ -0,0 +1,29 @@
|
||||
import std::thread;
|
||||
|
||||
fn void! bench1() @benchmark
|
||||
{
|
||||
return std::thread::sleep_ms(1);
|
||||
}
|
||||
|
||||
fn void! bench123456789() @benchmark
|
||||
{
|
||||
return std::thread::sleep_ms(2);
|
||||
}
|
||||
|
||||
fn void! long_name_bench() @benchmark
|
||||
{
|
||||
return std::thread::sleep_ms(3);
|
||||
}
|
||||
|
||||
fn void! very_long_name_bench() @benchmark
|
||||
{
|
||||
return std::thread::sleep_ms(10);
|
||||
}
|
||||
|
||||
static initialize
|
||||
{
|
||||
set_benchmark_warmup_iterations(5);
|
||||
set_benchmark_max_iterations(1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user