Hi,
another example:

\
: measure_doloop_empty 
timer-start 
10000 0 do 
\ here put the stuff to measure
loop 
timer-stop prnt_elapsed_ms ;

\
fvariable tmp
: measure_doloop_with_operation 
timer-start 
10000 0 do 
_pi _ln2 f* tmp f! 
loop 
timer-stop prnt_elapsed_ms ;

------------------
Example: results in ms
> measure_doloop_empty
47  ok
> measure_doloop_with_operation
109274  ok
>
So the operation "tmp = pi * ln2" takes (109.274sec -
0.047sec)/10000 = 10.92ms per operation. Not fast, however. Pito



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Amforth-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to