Browse Source
* Use fprintf because it doesn't buffer its output * Move Tracy test into auto-test block * Test Tracy and ProfilerAutoInstrumentwindows-imgui
10 changed files with 108 additions and 65 deletions
@ -0,0 +1,25 @@ |
|||
;; This might not be strictly necessary because auto-instrument imports Tracy for us. For now I'll |
|||
;; keep it until I figure out a better way to have instrument handle profiler selection |
|||
(import &comptime-only "Tracy.cake") |
|||
|
|||
(c-import "<stdio.h>") |
|||
|
|||
;; TODO: Linux only. For sleep() |
|||
(c-import "unistd.h") |
|||
|
|||
(defun-local hot-loop-body () |
|||
(sleep 1)) |
|||
|
|||
(defun main (&return int) |
|||
(fprintf stderr "Waiting for profiler to connect...\n") |
|||
(while (not (call-on IsConnected (call (in tracy GetProfiler)))) |
|||
(time-this-scope wait-for-profiler "wait for profiler") |
|||
(sleep 1)) |
|||
|
|||
(var i int 0) |
|||
(var num-times (const int) 10) |
|||
(while (< i num-times) |
|||
(fprintf stderr "hot loop %d / %d\n" i num-times) |
|||
(hot-loop-body) |
|||
(incr i)) |
|||
(return 0)) |
Loading…
Reference in new issue