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

Stopwatch Timer Expression

New Here ,
Sep 16, 2025 Sep 16, 2025

I am looking to make a stopwatch timer in AfterEffects with the Slide Control. I want to display minutes, seconds, and milliseconds (00:00:00). I cannot find the correct source text for it.

 

This is what I currently have:

slider = Math.round(effect("Slider Control")("Slider"))

sec = slider%60
min = Math.floor(slider/60)

function addZero(n){ if (n<10) return "0" + n else return n }

addZero(min) + ":" + addZero(sec)

TOPICS
Expressions
23
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 ,
Sep 16, 2025 Sep 16, 2025
LATEST

Try this:

slider = effect("Slider Control")("Slider").value;
function padZero(n){
  return (n < 10 ? "0" : "") + n;
}
min = Math.floor((slider%3600)/60);
sec = Math.floor(slider%60);
ms = slider.toFixed(2).substr(-2);
padZero(min) + ":" + padZero(sec) + ":" + ms
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