Re: jiffies gtk_main_iteration



Hi

thank you for your response and interest. Time measurements are done
with jiffies as unit on GNU/Linux. This depends on timer frequency from
100 up to 1000 Hz.

I'd really like to know how much computing time does gtk+ need to do its
job.

I have something like the following and want to know how to initialize
frequency:

struct _AgsGuiThread
{
  AgsThread thread;

  gdouble frequency;
  gdouble iter;
};

 /* */
for(i = 0; i < i_stop; i++){
  gtk_main_iteration();
  nanosleep(&wait, NULL);
}


 /* */
if(gui_thread->iter > gui_thread->frequency){
  gtk_main_iteration();
  gui_thread->iter = 0.0;
}else{
  gui_thread->iter += (gdouble) floor(1.0 / gui_thread->frequency);
}

please take a look at:

https://sourceforge.net/p/ags/wiki/threads/
https://sourceforge.net/p/ags/code/1036/tree/src/ags/thread/ags_gui_thread.c




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]