📐
Thunkable Docs
Build an AppDrag and Drop DocsSnap to Place Docs
Snap to Place
Snap to Place
  • 👋Welcome to Thunkable Docs
  • 👶Getting Started
    • Signing In
    • Your Thunkable Projects Page
    • Tutorials
    • Live Test your App
  • 🆕Create New Project
    • Project Settings
    • Project Assets and Sizes
  • Thunkable Sample Projects
  • Public Gallery of Projects
  • 🛠️ Components
  • 🔘User Interface
  • Button
  • Label
  • Text Input
  • List Viewer
  • Web Viewer
  • Switch
  • Slider
  • Alert
  • Loading Icon
  • Date Input
  • Time Input
  • PDF Reader
  • Rating
  • 📊Data Viewers
  • Data Viewer List
  • Data Viewer Grid
  • Custom Data Viewer Layout
  • Data Sources
  • 📐Layout
  • Top Tab Navigator
  • Bottom Tab Navigator
  • Stack Navigator
  • Drawer Navigator
  • Screen
  • Row
  • Column
  • 📷 Image
  • Image
  • Photo Library
  • Camera
  • Barcode Scanner
  • Image Recognizer
  • Animation by Lottie
  • Video
  • Video Recorder
  • 🗄️ Data
  • Local Storage
  • Local DB
  • Realtime DB by Firebase
  • Airtable
  • Media DB by Cloudinary
  • File Picker
  • Web API
  • 🌍Location
  • Maps by Google and Apple
  • Location Sensor
  • 💲Monetization
  • Ads by AdMob
  • In-App Purchase
  • 🌐Sensors
  • Gyroscope
  • Magnetometer
  • Accelerometer
  • Timer
  • Bluetooth Low Energy
  • 🔊Voice
  • Sound
  • Text to Speech
  • Speech Recognizer
  • Translator
  • Audio Recorder
  • 🤝Social
  • Share
  • Email Sign In by Firebase
  • Push Notifications by One Signal
  • 🎮Gaming
  • Canvas
  • Sprites
  • Sprite Gallery
  • Canvas Label
  • 🤖Gaming Blocks🎮
  • Events
  • Motion
  • Looks
  • Direction
  • Sensing
  • Add & Remove
  • Stage
  • Canvas Label
  • 🤖Blocks
  • Control
  • Logic
  • Math
  • Text
  • Lists
  • Color
  • Objects
  • Device
  • Variables
  • Functions
  • "Any Component" Blocks
  • 🖥️ App Services & Emulators
  • 🔒App Data Privacy
  • ➕Make Copy
  • 📥Download
  • 📤Share
  • 📱Publish
  • Publish to App Store (iOS)
    • TestFlight Overview
      • TestFlight in Depth
  • Publish to Play Store (Android) with AAB
  • Publish as a Web App
  • Generate Screenshots
  • 🔎Troubleshooting
    • Login Issues
    • FAQs
  • 📏Intro to Spacing
  • 🖼️ Intro to Sizing
  • 🔤Fonts
  • 💾Managing Storage
  • 📝Bugs and Product Feedback
  • Snap to Place Hour of Code Videos
Powered by GitBook
On this page
  • Properties
  • Event Blocks
  • When Timer Fires
  • Function Blocks
  • Start Timer
  • Stop Timer
  • Properties Blocks
  • Get Time
  • Interval
  • Count Up
  • Loops
  • Enabled
  • Example 1: How to Build a Stopwatch
  • Example 2: How to Build a Timer

Was this helpful?

Export as PDF

Timer

PreviousAccelerometerNextBluetooth Low Energy

Last updated 6 months ago

Was this helpful?

Properties

You can set:

  • The Name of the Timer

  • The Interval of the Timer, in seconds or milliseconds

  • Whether or not the Timer should Count Up

  • Whether the Timer should Loop, ie. if the Timer should reset itself once it fires

  • Whether the Timer is Enabled (this can be changed with blocks)

Event Blocks

When Timer Fires

Set something to happen when the Timer fires.

Function Blocks

Start Timer

Starts the Timer.

Stop Timer

Stops the Timer.

Properties Blocks

Get Time

Get time in seconds

If Count Up is false, returns remaining time from the Timer's interval in seconds.

If Count Up is true, returns elapsed time from the Timer's interval in seconds.

Get time in milliseconds

If Count Up is false, returns remaining time from the Timer's interval in milliseconds.

If Count Up is true, returns elapsed time from the Timer's interval in milliseconds.

Interval

Set Interval

Set interval of Timer in milliseconds.

Get Interval of Timer

Returns interval of Timer in milliseconds.

Count Up

Set Count Up

Set whether Count Up is enabled for this Timer.

Get Count Up

Returns true or false value for whether Count Up is enabled for this Timer.

Loops

Set Loops

If Loops = true, the timer will reset itself after it fires. If your interval is 10 seconds, the Timer will fire every 10 seconds.

If Loops = false, the timer will finish its current interval if it is in the middle of one, and will no longer fire. If your interval is 10s, the timer will finish its current 10 second interval, fire, and then stop.

Get Loops

Returns true or false value for whether Loops is enabled for this Timer.

Enabled

Set Enabled

Set whether the Timer is enabled.

Get Enabled

Returns true or false value for whether this Timer is enabled.

Example 1: How to Build a Stopwatch

  1. Start by creating a variable and set its value to 0 (this will keep track of the time).

  2. Add a timer to your project.

  3. Add a button that will start and pause the stopwatch.

  4. Inside the "when button click" block, add a condition: if the timer is running, pause the stopwatch; if it's not, start it.

  5. Set the timer interval to 1 second/1000 Milliseconds and enable looping so it keeps running.

  6. Add a label to display the elapsed time in seconds.

  7. Use the "when timer fires" block to increase the variable by 1 every second and update the label with the new value.

Example 2: How to Build a Timer

  • Start by creating a variable and set its value to 5000 to count five minutes.

  • Add a timer to your project.

  • Add a button that will start and pause the Timer.

  • Inside the "when button click" block, add a condition: if the timer is running, pause the Timer; if it's not, start it.

  • Set the timer interval to 1 second/1000 Milliseconds and enable looping so it keeps running.

  • Add a label to display the running time in seconds.

  • Use the "when timer fires" block to decrease the variable by 1 every second and update the label with the new value if the variable is greater than zero.