mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
27 lines
384 B
Plaintext
27 lines
384 B
Plaintext
module test;
|
|
import std::time;
|
|
import std::io;
|
|
|
|
alias foo = write;
|
|
|
|
alias Int = int;
|
|
|
|
macro @timeit(#call)
|
|
{
|
|
Clock t = clock::now();
|
|
var result = #call;
|
|
io::printfn("'%s' took %d ns", $stringify(#call), t.mark());
|
|
return result;
|
|
}
|
|
|
|
fn int write()
|
|
{
|
|
for (int i = 0; i < 1000; i++) io::printf("%d", i);
|
|
io::printn();
|
|
return 0;
|
|
}
|
|
|
|
fn void main()
|
|
{
|
|
@timeit(write());
|
|
} |