Author Topic: Ticks?  (Read 6758 times)

0 Members and 1 Guest are viewing this topic.

Offline gibaoran

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +1/-0
    • View Profile
Ticks?
« on: November 19, 2010, 01:12:47 am »
How would I tell when the clock has gained a second best?

I am currently using:

Code: [Select]
:getTime->LB
:getTime->LA
:while LA(3)=LB(3)
:getTime->LB
://Second passed, do stuff

I am 100% certain there is a better way.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Ticks?
« Reply #1 on: November 19, 2010, 01:48:29 am »
Here is my best idea...

startTmr→A
Repeat checkTmr(A
End

Offline gibaoran

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +1/-0
    • View Profile
Re: Ticks?
« Reply #2 on: November 19, 2010, 02:19:36 am »
Ty :D. I never figured out what Repeat does, just looked it up though. Thanks again

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Ticks?
« Reply #3 on: November 19, 2010, 02:21:43 am »
Not a problem! I have made many programs that use time, so I just happened to have an answer :D

Offline gibaoran

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +1/-0
    • View Profile
Re: Ticks?
« Reply #4 on: November 19, 2010, 02:36:55 pm »
So it almost works, except my timer starts  around this number 43438259, then counts up.
Maybe I am doing it wrong?
Code: [Select]
:ClrHome
:startTmr->A
:While 1
:Output(1,1,A
:Repeat checkTmr(A
:End
:A+1->A
:End

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Ticks?
« Reply #5 on: November 19, 2010, 02:38:43 pm »
Oh so you want a timer, then? I thought you just wanted it to wait for a second. Do you want it to count down? If so, from where?

Offline gibaoran

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +1/-0
    • View Profile
Re: Ticks?
« Reply #6 on: November 19, 2010, 02:40:04 pm »
It is counting up. Can you reset the timer?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Ticks?
« Reply #7 on: November 19, 2010, 02:43:11 pm »
What are you trying to do, I am confused...?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Ticks?
« Reply #8 on: November 19, 2010, 02:46:18 pm »
If you want to reset it, just run StartTmr( again.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Ticks?
« Reply #9 on: November 19, 2010, 02:48:32 pm »
Or is this what you want:
Code: [Select]
:ClrHome
:startTmr→A
:Repeat 0
:Output(1,1,checkTmr(A
:End

Offline gibaoran

  • LV2 Member (Next: 40)
  • **
  • Posts: 37
  • Rating: +1/-0
    • View Profile
Re: Ticks?
« Reply #10 on: November 22, 2010, 01:12:03 pm »
Thats it. Thanks :D. (And for the confusion, I have one prg thats just a timer, and one that is eventually going to be an analog clock :P)