[gecode-users] another question about stats

Mikael Zayenz Lagerkvist zayenz at kth.se
Fri Feb 27 15:15:21 CET 2009


Hi,

The time is measured using the clock() POSIX function, which measures
the elapsed CPU-time of the process that calls it. Calling usleep does
not put the process into a busy-loop (and thus incurring CPU-time), it
just delays the scheduling of that process. Compare the reported
runtime with running your program using the time wrapper command to
see the wall-clock time, user time, and kernel time.

If the program is busy (i.e., not calling functions such as usleep)
and is running on an otherwise unloaded machine, wall-clock time and
CPU-time will be roughly equal.

Cheers,
Mikael

On Tue, Feb 24, 2009 at 5:23 PM, David Przybilla <paranoic.pum at gmail.com> wrote:
> I made a small testing sample, I made a simple propagator and some variables
> subscribing to it.
> Inside the propagate method there is a usleep line, which is supposed to
> delay the execution for some seconds.
> When I run the example, the delay is there, however when  stats are shown,
> they say the example`s runtime was 0ms.
> what does "runtime" measure? am I doing  anything wrong?
> Also, Im making performance comparisons between some programs on Gecode old
> versions and between the same ones on Gecode 2.1.1,
> I wonder whether I should  measure the time on my own or just use the
> runtime thrown by gecode`s stats
>
> Thank you in advance!
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>



-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list