al_get_time
double al_get_time(void)
Introduced in 5.0.0
Return the number of seconds since the Allegro library was initialised. The return value is undefined if Allegro is uninitialised. The resolution depends on the used driver, but typically can be in the order of microseconds.
Examples: ex_bitmap, ex_bitmap_target, ex_blend, ex_blit, ex_clip, ex_convert, ex_d3d, ex_drawpixels, ex_draw_bitmap, ex_glext, ex_haiku, ex_logo, ex_membmp, ex_ogre3d, ex_opengl, ex_opengl_pixel_shader, ex_pixelformat, ex_premulalpha, ex_prim, ex_timer, ex_transform, ex_ttf
Most helpful discussions:
- How would I implement a FPS counter w/ Allegro 5 events? (1)
- keeping track of time (1)
- Using very short allegro timers in separate thread and getting lots of cpu usage
- Is al_get_time thread safe?
- Thread locks too soon
- Is there a way to wait before drawing a bitmap in Allegro5?
- Same code - slow on Windows, fast on Linux - timer fires too slow?
- very basic bitmap animation
- Some allegro 5 functions not working on some laptops
- [A5] How to properly implement limiting FPS?
Other recent discussions:
- [A5] How to implement smooth tile based movement
- Difference between my time loop and Allegro
- Allegro 5 basic game loop
- play video in loop
- Creating a Allegro 5 equivalent to _kbhit()
- al_set_target_bitmap slow (in release mode only)
- Windows Joystick Event Lag
- [algif 5] Unnecessary Transparency
- Complications when drawing FPS
- Advice for game loops with lengthy computations