This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Hendrik Kleine
Posted Apr 29 - Read on Facebook

Hello All!
I’m hoping for some tips on how to get started with a “prototype timer”.

The idea is that the user is given some sort of task (i.e. “Tap button X”) and I want to be able to measure in seconds how long it will take them.

When the user is ready to commence the task they will tap a start button, which must trigger a stopwatch which will run in the background, for example (not actual script):

Sketch.StartButton.onTap ->

Then when the user taps the right button which for me identifies the task is completed, the time should stop and the value stored for later retrieval. for example:

Sketch.ButtonX.onTap ->
SaveTime: “UserTime”

Then I can display a layer and insert this time, for example.

ResultLayer = new layer
ResulLayer.html = “You’ve completed the task in” <UserTime> “seconds”!

So this clearly isn’t actual script, but I hope you get the idea. My question is, can I run a background stopwatch and save the time for later retrieval and display as text?

Thank you for any suggestions :)


Wouter Van de Kamp

Think this is what you want? Right now everything is printed to the console but well. And might be a bit hacky. If someone has a cleaner solution, let me know. Always love to learn.

Read the entire post on Facebook