Add timing function
This commit is contained in:
parent
2f2aab828e
commit
6e70ad22c1
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace KeepersCompound.TMV;
|
||||||
|
|
||||||
|
public static class Timing
|
||||||
|
{
|
||||||
|
public static void TimeStage(string stagename, Action action)
|
||||||
|
{
|
||||||
|
var watch = Stopwatch.StartNew();
|
||||||
|
action();
|
||||||
|
watch.Stop();
|
||||||
|
Godot.GD.Print($"[{stagename}]: {watch.Elapsed:g}");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue