mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Implement builtin benchmarks.
This commit is contained in:
committed by
Christoffer Lerno
parent
6ebb3caa20
commit
b8c92c69b0
@@ -24,6 +24,7 @@ struct SubArrayStruct
|
||||
usz len;
|
||||
}
|
||||
|
||||
def BenchmarkFn = fn void!();
|
||||
def TestFn = fn void!();
|
||||
|
||||
struct TestUnit
|
||||
@@ -134,6 +135,16 @@ fn bool __run_default_test_runner()
|
||||
};
|
||||
}
|
||||
|
||||
fn bool __run_default_benchmark_runner()
|
||||
{
|
||||
BenchmarkFn[] fns = $$BENCHMARK_FNS;
|
||||
String[] names = $$BENCHMARK_NAMES;
|
||||
foreach (i, benchmark : fns)
|
||||
{
|
||||
io::printfn("Benchmark: %s %x.", names[i], fns[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
module std::core::runtime @if(WASM_NOLIBC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user