Files
xterm.js/test/index.html
T
Christopher Jeffrey 86dad1b087 better options handling.
2013-08-13 17:20:55 -05:00

50 lines
988 B
HTML

<!doctype html>
<title>term.js test</title>
<style>
h1 {
margin-bottom: 20px;
font: 20px/1.5 sans-serif;
}
</style>
<h1>term.js test</h1>
<script src="term.js"></script>
<script src="data.js"></script>
<script>
;(function() {
var time = new Date
, l = data.length * 0.9 | 0
, i = 0;
Terminal.cursorBlink = false;
var term = new Terminal({
cols: 80,
rows: 30,
useStyle: true
});
window.onload = function() {
// Add terminal.
term.open(document.body);
// Run benchmark.
(function write() {
if (i >= l) return next();
term.write(data[i]);
i++;
setTimeout(write, 1);
})();
// Results.
function next() {
term.write('\x1b[2J');
term.reset();
term.refresh(0, term.rows - 1);
term.writeln('Completed in ' + (new Date - time) + '.');
term.writeln('Writes: ' + l + '.');
term.writeln('Average (?): 28.5k (for ~2.5k writes).');
}
};
}).call(this);
</script>