Add timing function

This commit is contained in:
Jarrod Doyle 2024-08-26 13:22:29 +01:00
parent 2f2aab828e
commit 6e70ad22c1
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 15 additions and 0 deletions

View File

@ -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}");
}
}