mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
14 lines
273 B
Plaintext
14 lines
273 B
Plaintext
module test;
|
|
import std::time;
|
|
import std::io;
|
|
|
|
public macro timeit(#call)
|
|
{
|
|
Time t = time::current();
|
|
typeof(#call) result = #call;
|
|
TimeDiff diff = time::current() - t;
|
|
io::printf("'%s' took %f ms\n", $stringify(#call), diff * 1000);
|
|
return result;
|
|
}
|
|
|