From 6e70ad22c15e42429c64fca9abee72bf7412d622 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Mon, 26 Aug 2024 13:22:29 +0100 Subject: [PATCH] Add timing function --- project/code/TMV/Timing.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 project/code/TMV/Timing.cs diff --git a/project/code/TMV/Timing.cs b/project/code/TMV/Timing.cs new file mode 100644 index 0000000..8143b14 --- /dev/null +++ b/project/code/TMV/Timing.cs @@ -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}"); + } +} \ No newline at end of file