       program-id. timer.

       repository.
           class Stopwatch as "stopwtch"
           .
       working-storage section.
       01 wsCount                  pic  x(4) comp-5.
       01 wsStopWatch1             object reference Stopwatch.
       01 wsStopWatch2             object reference Stopwatch.
       01 wsChar                   pic x.
       01 wsTime.
        03 wsHours                 pic 99.
        03 filler                  pic x.
        03 wsMins                  pic 99.
        03 filler                  pic x.
        03 wsSecs                  pic 99.
        03 filler                  pic x.
        03 wsThousandths           pic 99.

       procedure division.
      *----T010. Create a new stopwatch.
           invoke Stopwatch "new" returning wsStopWatch1
      *----T020. Start the stopwatch running.
           invoke wsStopWatch1 "start"
      *----T030. Create a second stopwatch.
           invoke Stopwatch "new" returning wsStopWatch2
      *----T040. Query the number of stopwatches.
           invoke Stopwatch "howMany" returning wsCount
      *----T050. Start the second stopwatch running.
           invoke wsStopWatch2 "start"
      *----T060. Get time elapsed on first stopwatch.
           invoke wsStopWatch1 "getTimeFormatted" returning wsTime
           display "First stopwatch now running for:"
           display "Hr Mn Sc hundredths"
           display wsTime
      *----T070. Stop both watches.
           invoke wsStopWatch1 "stop"
           invoke wsStopWatch2 "stop"
      *----T080. Display time from both stopwatches.
           invoke wsStopWatch1 "getTimeFormatted" returning wsTime
           display "First stopwatch ran for:"
           display wsTime
           invoke wsStopWatch2 "getTimeFormatted" returning wsTime
           display "Second stopwatch ran for:"
           display wsTime
      *----T090. Finalize stopwatches.
           invoke wsStopWatch1 "finalize" returning wsStopWatch1
           invoke wsStopWatch2 "finalize" returning wsStopWatch2
           stop run

