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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:14:31+00:00 2026-05-11T20:14:31+00:00

This must be an easy question but I can’t find a properly answer to

  • 0

This must be an easy question but I can’t find a properly answer to it.

I’m coding on VS-C++. I’ve a custom class ‘Person’ with attribute ‘height’. I want to call class method Grow() that starts a timer that will increment ‘height’ attribute every 0.5 seconds.

I’ll have a StopGrow() that stops the timer and Shrink() that decrements instead of increment.

I really need a little push on which timer to use and how to use it within Grow() method. Other methods must be straight forward after knowing that.

That’s my first question here so please be kind (and warn me if I’m doing it wrong 🙂 Forgive my English, not my first language.

  • 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-11T20:14:31+00:00Added an answer on May 11, 2026 at 8:14 pm

    Do you really need to call the code every half second to recalculate a value? For most scenarios, there is another much simpler, faster, effective way.

    Don’t expose a height member, but use a method such as GetHeight(), which will calculate the height at the exact moment you need it.

    Your Grow() method would set a base height value and start time and nothing else. Then, your GetHeight() method would subtract the starting time from the current time to calculate the height “right now”, when you need it.

    No timers needed!

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

Sidebar

Related Questions

Now this must be easy, but how can sum two NSNumber ? Is like:
There must be an easy way to do this, but somehow I can wrap
I'm sure this must be possible, but I can't find out how to do
This must be a very simple question, but I don't seem to be able
I think this must be simple but I can't get it right... I have
I think this must be a stupid question, but why do the results of
Hopefully this is a brainlessly easy question, but it shows my lack of expertise
I feel like this is a stupid question, but I can't think of a
This must be a dumb question, but I cannot figure it out. I also
I know this must be asked a millions times and can't be easy to

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.