Jiffies and Seconds
Sixty-one jiffies is precise but means little to a human. Divide by 60 and you have seconds — the unit we think in. One line of arithmetic turns the clock's count into a time a person reads at a glance.
The clock counts in jiffies because that's how the C64 thinks — sixtieths of a second, ticking along. But a player doesn't think in jiffies. "You took 55 jiffies" lands flat; "you took nine-tenths of a second" lands. The two are the same number wearing different clothes, and the change of clothes is one division.
10 PRINT CHR$(147)
20 POKE 53281,0
30 PRINT "WATCH THE SCREEN..."
40 W=INT(RND(1)*120)+60
50 FOR T=1 TO W*8:NEXT T
60 POKE 53281,1
70 TI$="000000"
80 GET A$:IF A$="" THEN 80
90 RT=TI
100 POKE 53281,0
110 PRINT
120 PRINT "YOUR TIME"
130 PRINT RT;"JIFFIES"
140 PRINT RT/60;"SECONDS"
Line 140 is the new arithmetic: PRINT RT/60;"SECONDS". Because there are sixty jiffies in a
second, dividing the jiffy count by 60 gives the time in seconds. The C64 does the sum and
prints the result — .916666667, a hair under a second. The long trail of digits is the
machine being honest: 55 divided by 60 is exactly that endless fraction, and BASIC shows you all
the precision it has.
This is the first time you've done maths on a measurement — taken a raw number the machine gave you and turned it into something a person understands. Printing both, jiffies and seconds, keeps the machine's view and the human's view on screen together. The clock didn't change; only the way you read it did.
Try this
- Round it off. All those digits are noise. Try
PRINT INT(RT/60*10)/10;"SECONDS"to keep just one decimal place —.9reads far cleaner than.916666667. - In your own time. Time how long you can hold your breath, or how long a tune takes, by
resetting
TI$and readingRTlater. The clock measures any span, not just a flash.
What's next
You can measure a time and show it in seconds — but the program never judges it. In Unit 6 the machine reads the time and gives a verdict — LIGHTNING, QUICK, OK or SLOW — and catches anyone who tries to cheat.