@@ -28,14 +28,6 @@ def "tab" "name" (
2828 text name 8 : c#txtc
2929)
3030
31- def arrSum(arr) (
32- local out = 0
33- for i arr.len (
34- out += arr[i]
35- )
36- return out
37- )
38-
3931rightclick_menu = [
4032 "Unknown",
4133 "-",
@@ -81,6 +73,15 @@ def getWindowsData() (
8173 draw: windows_drawtimes[i]
8274 })
8375 )
76+ windows_total_time = windows_draw_main.sum()
77+ number system_time = max(0, floor(((delta_time * 1000) - windows_total_time) * 10) / 10)
78+ vals.append({
79+ name: "System",
80+ time: system_time,
81+ id: -1,
82+ draw: [system_time]
83+ })
84+ windows_list.append(vals[-1])
8485
8586 vals @= vals.sortBy("time").reverse()
8687 windows_list @= windows_list.sortBy("time").reverse()
@@ -96,7 +97,7 @@ last_timer = timer
9697next_update = 0.5
9798high = 0
9899low = 250
99- graph = 1000.newArray( )
100+ graph = (1 to 1000).fill(null )
100101
101102getWindowsData()
102103
@@ -185,7 +186,7 @@ if activity_info (
185186
186187wwm = window_width - 50 / 100
187188whm = window_height / 300
188- if paused.not() (
189+ if ! paused (
189190 // only add to the fps usage graph when not paused
190191 // fixes: https://discord.com/channels/1147362734300725298/1336340461555552319
191192 usage = (fps / fps_limit).clamp(0,1)
@@ -206,8 +207,8 @@ loc 2 2 23 - (high.len * 5) -70
206207text high 10
207208loc 2 2 12 -90
208209text "high" 7
209- loc 2 2 23 - (low. round().len * 5) -120
210- text low. round() 10
210+ loc 2 2 23 - (round(low ).len * 5) -120
211+ text round(low ) 10
211212loc 2 2 13.5 -140
212213text "low" 7
213214loc 2 2 23 - (delta.len * 5) -170
@@ -243,7 +244,7 @@ if timer - last_timer > next_update and !paused (
243244 last_timer = timer
244245 dt = delta_time
245246 getWindowsData()
246- number cpu_usage = roturLink.cpu.percent ?? (arrSum(windows_draw_main) / (1000 / fps_limit) * 100)
247+ number cpu_usage = roturLink.cpu.percent ?? (windows_total_time / (1000 / fps_limit) * 100)
247248 cpu_percent = round(cpu_usage).clamp(1,100)
248249 delta = cpu_percent ++ "%"
249250 updated = true
@@ -310,6 +311,16 @@ switch current_tab (
310311 )
311312
312313 // handle right clicking
314+ if windows_ids[count] == -1 (
315+ loc 2 2 25 y
316+ icon "origin-logo" 0.7 : c#txtc
317+ text "System" 7 : chx#20 c#txtc
318+ loc -2 2 -15 y
319+ d = windows_drawtimes[count][1]
320+ rigtext d.toStr() ++ "ms" 7
321+ y -= 40
322+ continue
323+ )
313324 object win_top @= windows_list[count] ?? {}
314325 object win @= win_top.window ?? {file: {uuid: win_top.uuid}}
315326 rightclick_menu[1] = "> " ++ win.file.uuid
0 commit comments