Hello again =)

I have anover small question: how I can get current FPS rate?

I can limit it like:
$self->app->min_t(1/FPS);
But if my computer too slow i want to see real FPS rate. And it`s need
to control myself because if I do something wrong then FPS drops down.


Hmmm, I think I would do something like this:

Add vars:
$frames = 0;
$before = Time::HiRes::time;

Add a show_handler:
if($frames >= 20) {
  $now    = Time::HiRes::time;
  $fps    = $frames / ($now - $before);
  $frames = 0;
  $before = $now;
  # blit fps to screen
}
$frames++;

Didnt tested it, but I think it should work this way...

--
Cheers, FROGGS

Reply via email to