[SDL] Re: threading overhead

Pierre Phaneuf pp at ludusdesign.com
Sun Apr 9 18:37:54 PDT 2000

Garrett wrote:

>   You could try using getrusage to time your program, that way you can see
> overhead a little better if there is any.

I wanted mostly a look at wall clock time, but I used "time" to see if
there was any noticeable difference between the two implementations, and
there was more system time. Here is an example for a single run that
resemble what I had with my multiple runs earlier today:

Running time: 35999 ms (single-threaded)
35.91user 0.02system 0:36.02elapsed 99%CPU (0avgtext+0avgdata
0inputs+0outputs (86major+32minor)pagefaults 0swaps

Running time: 40809 ms (multi-threaded)
39.32user 1.46system 0:40.84elapsed 99%CPU (0avgtext+0avgdata
0inputs+0outputs (104major+38minor)pagefaults 0swaps

I will add a switch for using getrusage.

Pierre Phaneuf

More information about the SDL mailing list