>I make an application that communicate via serial line at 19200,n,8,1
>and has 3 idle functions.
>One idle function get data for serial line and update a widget.
>One update a widget. The latter control a process quering the system by
>"clock" POSIX function e updating a label with the time value.
>
>Why the time value in the label changes slower that real-time?
>
>That is. I start countdown. After real 5 minutes the label display 3
>minutes.
>
>Why this difference? Is GTK lib that change time or is kernel linux that
>makes wrong operations?

>From "man clock":

       The clock() function returns an approximation of processor
       time used by the program.

what makes you think that your program is using 100% of the CPU 100%
of the time (the only possible way that clock(2) could return a time
value that changed at the same rate as the wall clock time)?

To measure wall-clock time, use time(2) or gettimeofday(2).

--p

_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to