Permalink
Browse files

add start of benchmarks

  • Loading branch information...
1 parent 5b9b51a commit 52004e95c32f46b059fae177d979a79698c5c2d9 @aheckmann committed Nov 2, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 benchmarks/index.js
View
@@ -0,0 +1,17 @@
+
+var gmp = require('./build/default/gmp');
+
+var a = "23450745058237458237438124381247381327401278039423904183123785901234679435237852037045375237485072304728904023748502374580723804572803745802374723098234509187142";
+var b = "90894587590237850247890451273126743687548782309875623443738065740178101237431274810018971234126789867123769146910981289658964389538365892375427436672345780686388";
+
+
+var num = 1000000;
+var start = Date.now();
+for (var i = 0; i < num; ++i){
+ gmp.mul(a,b);
+}
+var seconds = (Date.now()-start)/1000;
+var opssec = num / seconds;
+console.log("total time: %s seconds", seconds);
+console.log("ops per sec: %s", opssec);
+

0 comments on commit 52004e9

Please sign in to comment.