[PDD] Add docs for the Parrot_PMC_push_* and Parrot_PMC_pop_* functions
[parrot.git] / examples / mops / mops.ps
blob603b03cb57cb8e68150da3423aa2f1d1fe7de696
1 %!PS-Adobe
3 % mops.ps
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.
19 % $Id$
22 /I2 0 def                    % set    I2, 0
23 /I3 1 def                    % set    I3, 1
24 /I4 10000000 def             % set    I4, 10000000
25                              %
26 (Iterations:    ) print      % print  "Iterations:    "
27 I4 20 string cvs print       % print  I4
28 (\n) print                   % print  "\n"
29                              %
30 /I1 2 def                    % set    I1, 2
31 /I5 I4 I1 mul def            % mul    I5, I4, I1
32                              %
33 (Estimated ops: ) print      % print  "Estimated ops: "
34 I5 20 string cvs print       % print  I5
35 (\n) print                   % print  "\n"
36                              %
37 /N1 realtime 1000 div def    % time N1
38                              %
39 { I4 0 eq { exit } if        % REDO:
40   /I4 I4 I3 sub def          % sub    I4, I4, I3
41 } loop                       % if     I4, REDO
42                              %
43                              % DONE:
44 /N5 realtime 1000 div def    % time   N5
45                              %
46 /N2 N5 N1 sub def            % sub    N2, N5, N1
47                              %
48 (Elapsed time:  ) print      % print  "Elapsed time:  "
49 N2 20 string cvs print       % print  N2
50 (\n) print                   % print  "\n"
51                              %
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
56                              %
57 (M op/s:        ) print      % print  "M op/s:        "
58 N1 20 string cvs print       % print  N1
59 (\n) print                   % print  "\n"
60                              %
61 quit                         % end