midrange.com code scratchpad |
Name:
Buck
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
01/10/2008 08:56:39 pm
|
IP:
Logged
|
|
Description:
Performance evaluation of multiply vs divide in RPG /free V5R4M0
|
Code:
- d loops s 10i 0 inz(1000000)
- d i s 10i 0
- d start s z
- d end s z
- d dur s 10i 0
- d hhhh s 4p 0
- d wkscrtmin s 8p 0
-
- c/free
- start = %timestamp();
- for i = 1 to loops;
- HHHH = WKSCRTMIN / 10000;
- endfor;
- end = %timestamp();
- dur = %diff(end: start: *ms);
- dsply dur;
-
- start = %timestamp();
- for i = 1 to loops;
- HHHH = WKSCRTMIN * .00001;
- endfor;
- end = %timestamp();
- dur = %diff(end: start: *ms);
- dsply dur;
-
- *inlr = *on;
- /end-free
|
|
|