5 % Example command line:
7 % gs -q -DNODISPLAY mops.ps
9 % NOTE: 10,000,000 instead of 100,000,000 iterations are used
10 % to keep things from bogging down too much.
12 % A PostScript implementation of the mops.pasm example program,
13 % for speed comparisons.
15 % Copyright (C) 2001-2005, Parrot Foundation.
16 % This program is free software. It is subject to the same
17 % license as The Parrot Interpreter.
24 /I4 10000000 def % set I4, 10000000
26 (Iterations: ) print % print "Iterations: "
27 I4 20 string cvs print % print I4
28 (\n) print % print "\n"
31 /I5 I4 I1 mul def % mul I5, I4, I1
33 (Estimated ops: ) print % print "Estimated ops: "
34 I5 20 string cvs print % print I5
35 (\n) print % print "\n"
37 /N1 realtime 1000 div def % time N1
39 { I4 0 eq { exit } if % REDO:
40 /I4 I4 I3 sub def % sub I4, I4, I3
44 /N5 realtime 1000 div def % time N5
46 /N2 N5 N1 sub def % sub N2, N5, N1
48 (Elapsed time: ) print % print "Elapsed time: "
49 N2 20 string cvs print % print N2
50 (\n) print % print "\n"
52 /N1 I5 def % iton N1, I5
53 /N1 N1 N2 div def % div N1, N1, N2
54 /N2 1000000.0 def % set N2, 1000000.0
55 /N1 N1 N2 div def % div N1, N1, N2
57 (M op/s: ) print % print "M op/s: "
58 N1 20 string cvs print % print N1
59 (\n) print % print "\n"