How to Make a Digital Timer

Written by kevin lee
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Make a Digital Timer
As the minuntes tick away, watch them using a digital timer. (digital clock image by JoLin from

Use Windows to build your own digital timer to increase productivity. If you have trouble focusing, using a timer to monitor a task can help boost your energy and results. Windows comes with HTA technology. HTA stands for "HTML Application," and you can use it to build a simple digital timer to time important events.

Skill level:
Moderately Easy


  1. 1

    Open Notepad. It will launch and display an empty document.

  2. 2

    Add the following code to the document:




    TITLE = "Digital Timer"




    <script type="text/javascript">

    var timeToSleep;

    var start Time = 0;

    var digital Display;

    var timer Started = 0;

    var timer;

    var timer Button;

    / Set Colors Here /

    var fontColor = "red";

    var backgroundColor = "yellow";


    document.title = "Digital Timer";

    function init() {

    if (timer Started == 0) {

    digital Display = document.getElementById("DigitalDisplay");
    timer Button = document.getElementById("ButtonStartTimer");
    timer Started = 1;
    document.title = "Timer Started";
    start Timer();



    function reset Timer() {

    timer Started = 0;

    start Time = 0;

    digitalDisplay.value = "0";

    document.title = "Digital Timer";


    function start Timer() {

    timeToSleep = 1000;

    timer = set Timeout("increment Time()", timeToSleep);


    function increment Time() {

    start Time++;

    digitalDisplay.value = start Time; = fontColor; = backgroundColor;

    if (timerStarted)

    start Timer();




    <input id="ButtonStartTimer" type="button" value="Start" onclick="return init()" />

    <input id="Button1" type="button" value="Reset" onclick="return reset Timer()" />

    <input id="DigitalDisplay" type="text" value = "0" />


    This creates an HTA application.

  3. 3

    Press "Ctrl" plus "S." Notepad will display a window that allows you to save the document. You must save it with an "hta" file extension.

  4. 4

    Type the following in the "File Name" text box:


    Replace "xyz" with any name you like. For instance, if you want to call the program "My Timer," enter "My Timer.hta" (without the quotes).

  5. 5

    Click "Save" to save the file.

  6. 6

    Open Windows Explorer and locate the file. Double-click it. A pop-up window will open and display the digital timer.

  7. 7

    Click the timer's "Start" button. The timer will tick and display the passage of time. Click "Reset" when you need to reset the timer.

Tips and warnings

  • You can start as many digital timers as you like by clicking the file name in Windows Explorer. Each timer will run independently of the others. To change the font and background colours, locate these lines of code:
  • /* Set Colors Here */
  • var fontColor = "red";
  • var backgroundColor = "yellow";
  • Replace "red" and "yellow" with any colours you like. This allows you to customise the digital timer's appearance.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.