Timeout Intervals

timer

Checking timer intervals for waterfall display.

Glib::signal_timeout().connect(sigc::mem_fun(*this, &Waterfall::on_timeout), 70 );

The timeout interval is set to 70mS.

void cout_gettimeofday_diff(string myid, timeval t0, timeval t1) {
  if (t1.tv_usec < t0.tv_usec) {
    cout << myid << t1.tv_sec  - t0.tv_sec -1
          << "." << setfill('0') << setw(6) <<  1000000 + t1.tv_usec - t0.tv_usec << endl;
  } else {
    cout << myid << t1.tv_sec  - t0.tv_sec
          << "." << setfill('0') << setw(6) <<            t1.tv_usec - t0.tv_usec << endl;
  }
}

bool Waterfall::on_timeout() {
  static struct timeval t1, t1b4;
  gettimeofday(&t1, NULL);
  cout_gettimeofday_diff("Waterfall::on_timeout: interval: ", t1b4, t1);
  t1b4 = t1;
}
Waterfall::on_timeout: interval: 0.080361
Waterfall::on_timeout: interval: 0.073704
Waterfall::on_timeout: interval: 0.070262
Waterfall::on_timeout: interval: 0.070617
Waterfall::on_timeout: interval: 0.070572
Waterfall::on_timeout: interval: 0.070265
Waterfall::on_timeout: interval: 0.073217
Waterfall::on_timeout: interval: 0.070718
Waterfall::on_timeout: interval: 0.070061
Waterfall::on_timeout: interval: 0.070185
Waterfall::on_timeout: interval: 0.070964
Waterfall::on_timeout: interval: 0.074634
Waterfall::on_timeout: interval: 0.070707
Waterfall::on_timeout: interval: 0.070519
Waterfall::on_timeout: interval: 0.070174
Waterfall::on_timeout: interval: 0.070825
Waterfall::on_timeout: interval: 0.073477
Waterfall::on_timeout: interval: 0.070414
Waterfall::on_timeout: interval: 0.070088
Waterfall::on_timeout: interval: 0.070097
Waterfall::on_timeout: interval: 0.071018
Waterfall::on_timeout: interval: 0.070920
Waterfall::on_timeout: interval: 0.070908
Waterfall::on_timeout: interval: 0.070211

timer2

timer3

% R
> x <- read.csv("ttt.txt")
> hist(x[,1], col="orange", breaks=200)

Leave a Reply

Your email address will not be published. Required fields are marked *