I am writing a task scheduler for offloaded tasks in a game engine, and I want it to tune itself based on a few heuristics.
Is it possible to know for how long the current thread has been executed between two points in time? I want to time how long tasks take to execute, and I would like that time to exclude thread switching for multiple reasons (its a more accurate measurement, plus it would be useful to know how much my threads are being switched out).
I would like a solution for linux but a windows solution would also be appreciated
I am writing a task scheduler for offloaded tasks in a game engine, and
Share
Try to look at /proc/[pid]/task/[tid]/stat
Format is similar to /proc/[pid]/stat and explained here: http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html