Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!piglet!madler From: madler@piglet.caltech.edu (Mark Adler) Newsgroups: comp.sys.handhelds Subject: Re: hp48 graphics, timings, terminal emulator and more! Message-ID: <1990Apr11.043121.5506@laguna.ccsf.caltech.edu> Date: 11 Apr 90 04:31:21 GMT References: <5783@jarthur.Claremont.EDU> Sender: news@laguna.ccsf.caltech.edu Organization: California Institute of Technology, Pasadena Lines: 26 I use the following benchmark program: %%HP: T(3)A(R)F(.); @ TIMR crc #D3C0h length 74 \\<< MEM DROP @ do garbage collection TICKS \-> $$$ \<< @ save current tick count EVAL @ run program with stack contents TICKS @ get tick count when done $$$ - B\->R @ compute ticks elapsed 86 - @ adjust for time to assign $$$ and do TICKS 8192 / @ convert to seconds \>> \>> I believe storing the ticks in a local is more appropriate, since the execution time of the program will depend on how much stuff is on the stack, so the timing routine should not change that. Also, the garbage collection is necessary to get consistent results. Even with the MEM DROP, the timing is still dependant on the amount of free memory, since that determines how often garbage collection is done. I'll leave how to figure out the "86 -" as an exercise for the reader. Mark Adler madler@tybalt.caltech.edu