Re: timing a word

From: Ron Oliver <ron_at_forth.com>
Date: Tue, 02 Feb 2010 11:58:33 -0500

Ron Oliver wrote:
>
> e.g.: to test FOO:
> 1000 FOO PROFILE \ print time required to run FOO 1000 times

Oops! I meant

1000 PROFILE FOO \ print time required to run FOO 1000 times

Normally, what I'd do is just write a simple throwaway word:

: TIME-FOO ( -- ) uCOUNTER 1000 0 DO FOO LOOP uTIMER ;

There! It doesn't get any simpler than that.

-Ron
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue Feb 02 2010 - 08:59:03 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.