Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Whip's Profiler Graph Code
- int count = 1;
- int maxSeconds = 30;
- StringBuilder profile = new StringBuilder();
- bool hasWritten = false;
- void ProfilerGraph()
- {
- if (count <= maxSeconds * 60)
- {
- double timeToRunCode = Runtime.LastRunTimeMs;
- profile.Append(timeToRunCode.ToString()).Append("\n");
- count++;
- }
- else if (!hasWritten)
- {
- var screen = GridTerminalSystem.GetBlockWithName("DEBUG") as IMyTextPanel;
- screen?.WritePublicText(profile.ToString());
- screen?.ShowPublicTextOnScreen();
- if (screen != null)
- hasWritten = true;
- }
- }
- //Example usage
- void Main()
- {
- ProfilerGraph();
- //other shit
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement