Sub OuterLoop
subName = "OuterLoop" ' for profile
Profiler_Begin() ' for profile
TextWindow.WriteLine("")
Program.Delay(20)
ic = ic + 1
If 3 < ic Then
ic = 1
EndIf
TextWindow.ForegroundColor = color[ic]
Profiler_End() ' for profile
EndSub
Sub InnerLoop
subName = "InnerLoop" ' for profile
Profiler_Begin() ' for profile
TextWindow.Write(".")
Program.Delay(20)
Profiler_End() ' for profile
EndSub
Sub Profiler_Init ' for profile
Timer.Interval = 50
Timer.Tick = Profiler_OnTick
Profiler_sub = "main"
EndSub
Sub Profiler_OnTick ' for profile
profile[Profiler_sub] = profile[Profiler_sub] + 1
EndSub
Sub Profiler_Begin ' for profile
Stack.PushValue("local", Profiler_sub)
Profiler_sub = subName
EndSub
Sub Profiler_End ' for profile
Profiler_sub = Stack.PopValue("local")
EndSub
Sub Profiler_Dump ' for profile
nProfile = Array.GetItemCount(profile)
index = Array.GetAllIndices(profile)
For iProfile = 1 To nProfile
TextWindow.WriteLine(index[iProfile] + " : " + profile[index[iProfile]])
EndFor
TextWindow.WriteLine("")
EndSub