al_create_timer
ALLEGRO_TIMER* al_create_timer(double speed_secs)
Introduced in 5.0.0
Install a new timer. If successful, a pointer to a new timer object is returned, otherwise NULL is returned. speed_secs is in seconds per "tick", and must be positive. The new timer is initially stopped.
The system driver must be installed before this function can be called.
Usage note: typical granularity is on the order of microseconds, but with some drivers might only be milliseconds.
See also: al_start_timer, al_destroy_timer
Examples: ex_bitmap, ex_bitmap_flip, ex_blend, ex_blit, ex_clip, ex_display_options, ex_draw, ex_draw_bitmap, ex_expose, ex_filter, ex_gldepth, ex_glext, ex_haiku, ex_icon, ex_iphone, ex_logo, ex_multisample, ex_native_filechooser, ex_noframe, ex_ogre3d, ex_premulalpha, ex_prim, ex_resize, ex_stream_seek, ex_threads, ex_threads2, ex_timer, ex_transform, ex_ttf, ex_user_events
Most helpful discussions:
- How to create multiple timers? (1)
- al_wait_for_event won't catch the timer. (1)
- Having Trouble with exit(1) - Stalling Program
- My second game, space invader simplified
- Vivace extra points. Its there a better way of doing this one.
- I'm new
- Key-presses speed-up program
- Math question (2d trig)
- Multiple threads/displays, Event handling question
- I am looking for correct detailed instructions how to build Allegro....
Other recent discussions:
- Is there a way to wait before drawing a bitmap in Allegro5?
- Difficulty compiling on Windows
- Screen is cleared and a new one appears Allegro5 in C?
- Same code - slow on Windows, fast on Linux - timer fires too slow?
- KrampusHack 2020: Odd Results With Color Mapping Functions
- Allegro 5 performance
- Rendering A Hot Air Balloon
- Game Crashing and I'm not sure why?
- Mingw do not find Allegro lib
- got a bug in my FULLSCREEN WINDOWED MODE switchout