public static long GetElapsedTime(string function) { if (enableProfiling) { Stopwatch stopwatch = Timers[function]; return stopwatch.ElapsedMilliseconds; } else { return 0; } }