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:
  1.      d loops           s             10i 0 inz(1000000)
  2.      d i               s             10i 0
  3.      d start           s               z
  4.      d end             s               z
  5.      d dur             s             10i 0
  6.      d hhhh            s              4p 0
  7.      d wkscrtmin       s              8p 0
  8.  
  9.      c/free
  10.        start = %timestamp();
  11.        for i = 1 to loops;
  12.          HHHH = WKSCRTMIN / 10000;
  13.        endfor;
  14.        end = %timestamp();
  15.        dur = %diff(end: start: *ms);
  16.        dsply dur;
  17.  
  18.        start = %timestamp();
  19.        for i = 1 to loops;
  20.          HHHH = WKSCRTMIN * .00001;
  21.        endfor;
  22.        end = %timestamp();
  23.        dur = %diff(end: start: *ms);
  24.        dsply dur;
  25.  
  26.        *inlr = *on;
  27.        /end-free
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css