It's the source of SpeedTest from PalmInternals utility. void MakeSpeedTest(char *p){ int i; UInt32 t0, t1; UInt32 s0, s1; // clear event queue while(EvtEventAvail()){ EvtGetEvent(&e, 0); } t0 = TimGetTicks(); s0 = TimGetSeconds(); for(i = 0; i < 10000; ++i){ EvtEnqueueKey(vchrBacklight, 0, commandKeyMask); EvtGetEvent(&e, 0); } t1 = TimGetTicks(); s1 = TimGetSeconds(); StrPrintF(p, "Time in tics %ld, time in secs %ld\n", t1 - t0, s1 - s0); }