Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

is it possible to make a timer with AS3 which is accurate upto one millisecond.

Guest
Jun 07, 2014 Jun 07, 2014

I am new to AS3. I have somehow developed a auditory and visual reaction timer by taking script from here and there. I know its not accurate and I also know that I will write it correctly when I have learned the script thoroughly,

But I was checking the net about the timer class and various posts on it and  I am vexed with a question "if its possible to make an accurate timer with AS3?" can somebody please tell me for sure. and I will be grateful if I know how to make it correctly. I can post the code which I have written ( assembled ).

TOPICS
ActionScript
850
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 07, 2014 Jun 07, 2014

the answer is, maybe. but for, for most coders, the answer is, no.

getTimer() is accurate to within 1 ms.  but that allows you to determine time/elapsed time and does not call or execute code on a regular timed schedule. it can be used with the timer class or enterframe events to do some things accurately.

however, the timer class is not accurate in the way beginning coders think.  it will, on average, allow calling a function at close to the designated interval if there are no performance issues

...
Translate
Community Expert ,
Jun 07, 2014 Jun 07, 2014

the answer is, maybe. but for, for most coders, the answer is, no.

getTimer() is accurate to within 1 ms.  but that allows you to determine time/elapsed time and does not call or execute code on a regular timed schedule. it can be used with the timer class or enterframe events to do some things accurately.

however, the timer class is not accurate in the way beginning coders think.  it will, on average, allow calling a function at close to the designated interval if there are no performance issues with your swf.  it does not allow each function call to occur at a regular interval.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 07, 2014 Jun 07, 2014

Thanks for the meaningful reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2014 Jun 08, 2014

you're welcome.

p.s. please mark helpful/correct responses, if there are any.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 11, 2014 Jul 11, 2014

how to mark a response? cant find how to do that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2014 Jul 11, 2014
LATEST

in each message body there's a "correct answer" button and below the body is an actions dropdown.  you may need to use a different browser to see that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 09, 2014 Jun 09, 2014

You might want to take a look at this: http://jacksondunstan.com/articles/2348

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2014 Jun 09, 2014

that's for timing code execution, not the display.  in addition, unless your computer-state (not just your flash-state) is constant, that's useless, and i don't think anyone's computer-state is constant.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines