public static void StartTimed(int Channel) { if (Channel < 0 || Channel >= NumChannels) { return; } if (depth == 0) { CurrentChannel = Channel; ChannelData data = channels[Channel]; data.startTicks = Stopwatch.GetTimestamp(); // Convert this to Log.buf //MonoBehaviour.print("StartTimed " + Channel + " start = " + data.startTicks); } depth++; }
public static void StopTimed() { // If we aren't in any function then do nothing if (depth == 0) { return; } depth--; if (depth == 0) { ChannelData data = channels[CurrentChannel]; long endTicks = Stopwatch.GetTimestamp(); long deltaTicks = endTicks - data.startTicks; data.totalTicks += deltaTicks; // Convert this to Log.buf //MonoBehaviour.print("StopTimed " + CurrentChannel + " end = " + endTicks + " delta = " + deltaTicks); CurrentChannel = -1; } }