---
name: "fli_timer"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/fli_timer"
---

# fli\_timer(3alleg)

Global variable for timing FLI playback. Allegro game programming library.

## NAME

fli\_timer - Global variable for timing FLI playback. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**extern volatile int fli\_timer;**

## DESCRIPTION

Global variable for timing FLI playback. When you open an FLI file, a  timer interrupt is installed which increments this variable every time a  new frame should be displayed. Calling next\_fli\_frame() decrements it, so  you can test it and know that it is time to display a new frame if it is  greater than zero. Example:

```
   while (next_fli_frame(0) == FLI_OK) {
      /* Do stuff, like play audio stream
         or check keys to skip animation. */
      /* Rest some time until next frame... */
      while (fli_timer <= 0)
         rest(0);
   }
```

## SEE ALSO

[**install\_timer**(3alleg)](/install_timer/3alleg.md), [**next\_fli\_frame**(3alleg)](/next_fli_frame/3alleg.md)
