Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7917435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:08:44+00:00 2026-06-03T15:08:44+00:00

const float FPS = 60; timer = al_create_timer(1.0 / FPS); Apparently, those two lines

  • 0
const float FPS = 60;
timer = al_create_timer(1.0 / FPS);

Apparently, those two lines start a timer that goes off 60 times per second.

I don’t understand that. 1/FPS gives 1/60, and docs say the parameter of al_create_timer is the number of seconds it counts per tick, so it counts 1/60 of a second per tick. So…is that to say the timer conveniently ticks 60 times per second? I’m not understanding these units.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:08:45+00:00Added an answer on June 3, 2026 at 3:08 pm

    The units are seconds. If you want it to go off 60 times per second, then the timer lasts 1/60th of a second. If you want it to go off 5 times per second, then you would set the length between timer firings to be 1/5 of a second.

    Think of setting the time interval of the timer rather than the number of times per second (or frequency) of the timer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

strange situation, when performing the following lines of Code: const float a = 47.848711;
In the following code, the const are defined using two different ways. const float
Suppose that I have the following c function: int MyFunction( const float arr[] )
I have some simple code that is comparing two float values to illustrate a
Suppose I have variables for positions like const float latitude = 51.+11./60.+33.0461/3600.; const float
I have a static class data member declared as: static const float MINIMUM_ZOOM_FACTOR =
I have my own, very fast cos function: float sine(float x) { const float
A little test program: #include <iostream> const float TEST_FLOAT = 1/60; const float TEST_A
Possible Duplicate: C++ typedef interpretation of const pointers I just learned that typedef does
Why does this bit of code, const float x[16] = { 1.1, 1.2, 1.3,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.