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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:11:37+00:00 2026-05-28T11:11:37+00:00

So I am calculating an equation so that I can echo out a statistic.

  • 0

So I am calculating an equation so that I can echo out a statistic. This statistic will be bounced back to HTML via ajax and written out to the user. a setInterval will make sure that it gets updated real time. It is very similar to this http://www.usagain.com/ on the left hand side. The problem is I want to start this incrementation at a certain number.

I’m basing it off of the $_SERVER[REQUEST_TIME] so that it always increments and only ever gets reset once it reaches its max. The problem is I need to define a starting number. Here is the equation that user Uboonto came up with:

value = ( timestamp % ((max_limit - min_limit) / 1.5 ) ) * 1.5 + min_limit

This will increment ever second by 1.5 – the problem is that this equation starts randomly between $min and $max instead at a starting number I define. Does anybody know how to modify this equation so I can have a starting number that I can define?

I tried:

value = ( (timestamp + modifier) % ((max_limit - min_limit) / 1.5 ) ) * 1.5 + min_limit

and

value = ( (timestamp - modifier) % ((max_limit - min_limit) / 1.5 ) ) * 1.5 + min_limit

but no luck. I’m open to suggestions.

  • 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-05-28T11:11:38+00:00Added an answer on May 28, 2026 at 11:11 am

    One approach would be to just calculate the difference between some arbitrary point in time and a known value at that time and multiply by the number of increments per second:

    $startValue = 1000000; // 1 million
    $startTime  = mktime(0, 0, 0, 1, 1, 2012); // 2012-01-01 00:00:00
    $incPerSec  = 1; // increment $startValue by this for every second elapsed since $startTime
    $seconds    = time() - $startTime;
    
    $value = $startValue + ($seconds * $incPerSec);
    
    echo $value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a two part question: Part 1 First, dealing with calculating the entropy
New to objective-c and I just can't find the answer to this question anywhere.
I've distilled an equation down to this: speed = ( ( rear_wheel_speed_a + front_wheel_speed_a
I’m using this equation to convert steps to estimated calories lost. I now need
I'm asking this questions out of curiostity, since my quick and dirty implementation seems
I'm looking at this wikipedia article: http://en.wikipedia.org/wiki/Day_length http://en.wikipedia.org/wiki/Sunrise_equation Anybody had experience calculating Sunrise/Sunset times
In Mathematica if I have a symbolic algebra equation, how can I get the
I have a small app, where user can make some calculations and solve equations.
Without calculating them , I mean?
While calculating the hash table bucket index from the hash code of a key,

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.