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