TIMEEVAL, an object-execution timer v1.0 From: phk@data.fls.dk (Poul-Henning Kamp) Newsgroups: comp.sources.hp48 Date: 1 Oct 91 02:38:36 GMT [Note: This is for those who desire the functionality of the XTIME command in Jim Donnelly's TOOL LIBRARY (a commercial product) without having that whole library in memory. -jkh-] obj TIMEEVAL --> n(ticks) x_ms Evaluates the object on top of the stack, and returns the time it took in ticks of the internal clock and in milli-seconds. Arguments for can put put on the stack above it, and results from the evaluation will be available above the results of TIMEEVAL. example: +----------------------+ +----------------------+ |4: | |4: | |3: | |3: .908508177527| |2: 65.3| |2: 247| |1: SIN| -> TIMEEVAL -> |1: 30.151_ms| +----------------------+ +----------------------+ You cannot get SIN onto the stack ? try this: { SIN } OBJ\-> DROP The T0 offset is (on my calc, Rev E) 31 ticks, or 3.784_ms. This is roughly the time it takes to evaluate a data-object like "Hello". WARNINGS: ========= The EVAL employed is the "kernel-one", which does not evalute inside lists. Programs relying on a specific local-env will fail if they use 1GETLAM &c &c. There is no ERRTRAP built in. -- phk@data.fls.dk || A host is a host from coast to coast, Poul-Henning Kamp || & no one will talk to a host that's close, FLS DATA A/S || Unless the host (that isn't close) Phone: (+45) 36 18 12 35 || is busy, hung or dead. Fax: (+45) 36 18 12 18 || Anon (?)