28 lines
493 B
HTML
28 lines
493 B
HTML
<html>
|
|
<head>
|
|
<script src="gauss.js">
|
|
</script>
|
|
<script>
|
|
invoke(function() {});
|
|
var f = MACHINE.env.globalBindings.gauss.adaptToJs();
|
|
|
|
var startTime;
|
|
|
|
var N = 1000000;
|
|
|
|
startTime = new Date();
|
|
f([N], function(v) { console.log("functions", v, new Date() - startTime); });
|
|
|
|
|
|
var add = function(x, y) { return x + y; }
|
|
startTime = new Date();
|
|
var acc = 0;
|
|
for (var i = 1; i <= N; i++) {
|
|
acc = add(acc, i);
|
|
}
|
|
console.log("loops", acc, new Date() - startTime);
|
|
</script>
|
|
<body>
|
|
</body>
|
|
</html>
|