]> git.cworth.org Git - fips/commit
Capture and print CPU load on a per-frame basis.
authorCarl Worth <cworth@cworth.org>
Sat, 9 Nov 2013 20:23:53 +0000 (12:23 -0800)
committerCarl Worth <cworth@cworth.org>
Mon, 11 Nov 2013 18:31:42 +0000 (10:31 -0800)
commit0289d15f5ac659f32b5c201aefdad92a184eed6b
tree661653ad9f29d94f16613c8f237a1e3c5c46a13f
parentd9086ea8efecea9efbcd46a68eb96a68ce88543b
Capture and print CPU load on a per-frame basis.

We use clock_gettime to measure the amount of CPU time accrued by the
active process. Then, by subtracting the value between succesive frame
times and dividing by the total wall-clock time for the frame, we
determine a measure of the per-frame CPU load from 0.0 to 1.0.

We now print the frame number, frame time, frame latency, and CPU load
in a single-line format for simpler parsing, (with a header comment
describing the names and units for each field).
metrics.c