public static void timer(__forTimer f, params string[] name) { assert(name.Length <= 1); Stopwatch watch = new Stopwatch(); watch.Start(); f(); watch.Stop(); float seconds = (watch.ElapsedMilliseconds / 1000.0f); if (name.Length > 0) print(name[0], ":", seconds); else print(seconds); }
public static void timer(__forTimer f, params string[] name) { assert(name.Length <= 1); Stopwatch watch = new Stopwatch(); watch.Start(); f(); watch.Stop(); float seconds = (watch.ElapsedMilliseconds / 1000.0f); if (name.Length > 0) { print(name[0], ":", seconds); } else { print(seconds); } }