mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-14 19:43:46 +08:00
+8
-5
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import time
|
||||
|
||||
from cereal import messaging
|
||||
from openpilot.system.hardware import TICI
|
||||
@@ -24,14 +25,10 @@ def main():
|
||||
|
||||
pm = messaging.PubMaster(['uiDebug'])
|
||||
for should_render, frame_time, cpu_time in gui_app.render():
|
||||
extra_start = time.monotonic()
|
||||
ui_state.update()
|
||||
|
||||
if should_render:
|
||||
msg = messaging.new_message('uiDebug')
|
||||
msg.uiDebug.cpuTimeMillis = cpu_time * 1000
|
||||
msg.uiDebug.frameTimeMillis = frame_time * 1000
|
||||
pm.send('uiDebug', msg)
|
||||
|
||||
# reaffine after power save offlines our core
|
||||
if TICI and os.sched_getaffinity(0) != cores:
|
||||
try:
|
||||
@@ -39,6 +36,12 @@ def main():
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
extra_cpu = time.monotonic() - extra_start
|
||||
msg = messaging.new_message('uiDebug')
|
||||
msg.uiDebug.cpuTimeMillis = (cpu_time + extra_cpu) * 1000
|
||||
msg.uiDebug.frameTimeMillis = frame_time * 1000
|
||||
pm.send('uiDebug', msg)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user