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 8218337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:45:35+00:00 2026-06-07T12:45:35+00:00

I have a piece of code running into an loop, with a division by

  • 0

I have a piece of code running into an loop, with a division by 100, which is reducing a little my fps count.

In majority of cases, is a int/uint type being divided by 100, resulting in a simple Number.

I just want to know any way to optimize that.

EDIT:
Little benchmark with the @scriptocalypse suggestion – multiplying for 0.01:

import flash.utils.getTimer;

for(var k:Number = 20; k > 0; k--)
{
    var a:int = getTimer();

    var o:Number = 100;
    var p:Number;
    for(var i:Number = 100000000; i > 0; i--)
    {
        p = o * 0.01;  // took 423~510   <--------------
        //p = o / 100;  // took 713~768   <--------------
    }

    var b:int = getTimer();

    trace( b - a);
}
  • 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-07T12:45:38+00:00Added an answer on June 7, 2026 at 12:45 pm

    I suspect that it’s not the division that’s causing the bulk of your issues, as even slow math operations should be relatively fast compared to other operations.

    While this:

    x * 0.01;
    

    should theoretically be faster than

    x / 100;
    

    I still suspect that it won’t make much difference. What else are you doing in your loop?

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

Sidebar

Related Questions

I have following piece of code which posts some data into database: $post =
I have the following piece of code which uses the ALAssets library to store
I have a piece of code in my game which looks a lot like
I have written a piece of code in python, in which I am asking
I have two pieces of C++ code running on 2 different cores. Both of
Here I have piece of code, showing example of how I want to update
I have a piece of code like this: <div id=container runat=server> <div id=parent runat=server>
I have this piece of code in a function. I want to print the
I have a piece of code that was written by someone else before the
I have this piece of code: public static DateDialogFragment newInstance(Context context, DateDialogFragmentListener listener) {

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.