Can you help me with my timer?

Screenshot 2020-08-25 at 4.51.20 PM

Which the context of what you are trying to achieve, I just assume you are doing a stopwatch kind of thing.:

1st, what is the repeat block for? there is no condition set to stop the loop, hence the blocks for button text will never be executed.

2nd, I see that you are trying to count the milliseconds and then use conditions to raise it to seconds. But actually having the Timer to help “fire” an event, you already are getting the system to help you count and you just need to simply count the number of times it triggered. Then divide the number by 1000. you get seconds in decimal and show it out on your button text. But do take note that your codes may take longer than 1 millisecond to execute, So maybe you should trigger in 10 milliseconds interval. Human cannot differentiate 1 milliseconds or 10 millisecond anyway.

Can you show me a picture? I’m just doing this for a school project so I don’t really understand what you’re saying. And for the repeat block, I don’t even know what’s its function. Do you mind explaining it?

How do you count the number of times the timer triggered? And what is milliseconds interval?

Does the interval affect the timing? I am making a timer with 2 decimal places as I need it to be more accurate.

Clipboard02

I am still not sure what you want to do with the button, seemed nothing to do with the timer and it clicked to go to another screen. But here is what I would do to display the seconds time-ticking in 2 decimal places.

I used a full screen button instead of a label on a screen so I can stop the button by touching anywhere on the screen. The button goes to the next screen for the user to choose whether they want to save or delete the time. Is it possible for the timer to display the previous time when I am starting it again? And my timer is still displaying 0.01 when I start the app. After trying out your code, my timer is still not running. It just displays 0. Is it because I used a button instead of a label?

My blocks above are just an illustration of how it would work. you need to add in your own implementations. 2 things to note though, 1. you need to put in your own conditions to start the timer. i.e you set the trimer default enable to “off”, then use a start button to enable the timer to start “firing”. 2. yes you can have the previous time display. just add another variable to store it and then recall it back the next time the app is used.

Screenshot 2020-08-26 at 8.43.43 PM Screenshot 2020-08-26 at 8.45.10 PM
I have tried it again but it still doesn’t work. Can you point out the error?

Does the time interval affect the timing? My timer still displays 0.01 when I start it. And can you explain the function of the repeat block?

Can you share your program for mixing? you are counting milliseconds and my suspicion is that codes may take longer than 1 milliseconds to run. you may need to do some trial and error what interval works for you.

I don’t understand what you’re saying. What is “your program for mixing”? And what does interval milliseconds mean.

means you share your app. put the link here, then i may take a look.

Sorry for the late reply. I honestly want to give up on this project but I believe that you can fix the problem. Here’s the link.

You have 5 screens, which is the main one? Can you tell me exactly what you want to do with the clock? does it simply count and user press button to go to another screen? and in the new screen, do what? Trying to help but I can’t guess what you are trying to do there.

Thanks

The screens go in this order. Timer_tab, Screen1, Screen2. For the saves and stats, the user can access them using the bottom tab navigator. Screen1 was needed because a button only can have one function. Fyi I made the button the size of the screen so that the user can start the timer by tapping anywhere on their phone screen. When the button in Screen1 (the size of the screen) is pressed it brings the user to Screen2 and allows the user to choose if they want to delete or +2 to their time etc. (I have my reason for that). I still can’t think of a better method since there’s no when button swipe left or when button double tap block.

I think you have a better idea of what I’m doing now. Hopes this helps you.
(P.s. Do you know what is the difference between the from timer set enabled to true block and the from timer call start block?)

Hi, sorry for the late reply, I was doing something else the past couple of weeks.
https://x.thunkable.com/copy/a2be691b61bfda79a9b6f68b2f3f6ffe
please see if this is what you wanted. It works now. Basically, you want the event to only trigger when you start and enable the “loop” so that it will trigger forever until you disable. So simply, every trigger, count up 10 milliseconds. Hops this helps.

sorry you have to code all the “safe” adjust scores etc yourself…