Use RUSAGE_SELF for the current process instead of hardcoded value

This commit is contained in:
Kevin Lo 2008-09-02 02:59:38 +00:00
parent 1f0e597d5a
commit 4c6ea66f44

View File

@ -325,7 +325,7 @@ cputime ()
{
struct rusage rus;
getrusage(0, &rus);
getrusage(RUSAGE_SELF, &rus);
return(rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000);
}
#endif /* DEBUG */