[svn:parrot] r37104 - trunk/examples/mops
japhb at svn.parrot.org
japhb at svn.parrot.org
Wed Mar 4 06:19:19 UTC 2009
Author: japhb
Date: Wed Mar 4 06:19:18 2009
New Revision: 37104
URL: https://trac.parrot.org/parrot/changeset/37104
Log:
[examples/mops] mops.p6: fix comments and pod to match mops_intval.pasm
Modified:
trunk/examples/mops/mops.p6
Modified: trunk/examples/mops/mops.p6
==============================================================================
--- trunk/examples/mops/mops.p6 Wed Mar 4 06:19:13 2009 (r37103)
+++ trunk/examples/mops/mops.p6 Wed Mar 4 06:19:18 2009 (r37104)
@@ -13,7 +13,7 @@
=head1 DESCRIPTION
-A Perl 6 implementation of the F<examples/benchmarks/mops.pasm>
+A Perl 6 implementation of the F<examples/benchmarks/mops_intval.pasm>
benchmark, for speed comparisons.
Calculates a value for Mops (also known as M ops/s or million
@@ -48,43 +48,44 @@
=end pod
sub MAIN() {
- my ($I1, $I2, $I3, $I4, $I5, $N1, $N2, $N4, $N5);
-$I2 = 0; # set I2, 0
-$I3 = 1; # set I3, 1
-$I4 = 1000000; # set I4, 100000000
- #
+ my ($I1, $I2, $I3, $I4, $I5, $N1, $N2, $N4, $N5);
+
+$I2 = 0; # set I2, 0
+$I3 = 1; # set I3, 1
+$I4 = 1000000; # set I4, 100000000
+ #
print "Iterations: ",$I4,"\n"; # print "Iterations: "
- # print I4
- # print "\n"
- #
-$I1 = 2; # set I1, 2
-$I5 = $I4 * $I1; # mul I5, I4, I1
- #
+ # print I4
+ # print "\n"
+ #
+$I1 = 2; # set I1, 2
+$I5 = $I4 * $I1; # mul I5, I4, I1
+ #
print "Estimated ops: ",$I5,"\n"; # print "Estimated ops: "
- # print I5
- # print "\n"
- #
-$N1 = time;
- #
-$I4 = $I4 - $I3 # sub I4, I4, I3
- while ($I4>0); # if I4, REDO
- #
-$N5 = time;
- #
-$N2 = $N5 - $N1; # sub N2, N5, N1
- #
+ # print I5
+ # print "\n"
+ #
+$N1 = time; # time N1
+ #
+$I4 = $I4 - $I3 # sub I4, I4, I3
+ while ($I4>0); # if I4, REDO
+ #
+$N5 = time; # time N5
+ #
+$N2 = $N5 - $N1; # sub N2, N5, N1
+ #
print "Elapsed time: ",$N2,"\n"; # print "Elapsed time: "
- # print N2
- # print "\n"
- #
-$N1 = $I5; # iton N1, I5
-$N1 = $N1 / $N2; # div N1, N1, N2
-$N2 = 1000000.0; # set N2, 1000000.0
-$N1 = $N1 / $N2; # div N1, N1, N2
- #
+ # print N2
+ # print "\n"
+ #
+$N1 = $I5; # set N1, I5
+$N1 = $N1 / $N2; # div N1, N1, N2
+$N2 = 1000000.0; # set N2, 1000000.0
+$N1 = $N1 / $N2; # div N1, N1, N2
+ #
print "M op/s: ",$N1,"\n"; # print "M op/s: "
- # print N1
- # print "\n"
- #
-} # end main
+ # print N1
+ # print "\n"
+ #
+} # end
More information about the parrot-commits
mailing list