Website/node_modules/mathjax-node/x-old-stuff/tape leftovers/test2.js

34 lines
683 B
JavaScript

/*eslint-env node */
var mjAPI = require("./lib/mj-single.js");
mjAPI.config({
MathJax: {
}
});
mjAPI.start();
var start = Date.now();
for (var i = 0; i < 100; i++) {
var input = "\\sqrt{f: X \\to Y } " + i;
console.log("\\[" + input + "\\]");
mjAPI.typeset({
math: input,
format: "TeX", // "inline-TeX", "MathML"
// speakText: true,
svg: true,
mml: true
}, function(data) {
"use strict";
if (!data.errors) {
// console.log(data.svg);
// console.log(data.mml);
// console.log(start);
console.log(Date.now() - start);
}
});
}
var end = Date.now();
console.log(start);
console.log(end);
console.log(end - start);