aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-10 21:39:06 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-10 21:39:06 -0800
commit3bb150e5e689a6e58d485f2b87c15e38ccf50ae7 (patch)
tree7913d296b3033187701bc9c0896b33a98c53d235
parent958505853ebd24fd3c0dc2bc6f6fb0615a48c8b7 (diff)
Timings: added 'preparing input'.
-rw-r--r--js/lib/blocks.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
index c2d14d7..b1f69eb 100644
--- a/js/lib/blocks.js
+++ b/js/lib/blocks.js
@@ -671,16 +671,18 @@ var Document = function() {
// The main parsing function. Returns a parsed document AST.
var parse = function(input) {
"use strict";
- if (this.options.time) { console.time("block parsing"); }
this.doc = Document();
this.tip = this.doc;
this.refmap = {};
+ if (this.options.time) { console.time("preparing input"); }
var lines = input.split(reLineEnding);
var len = lines.length;
if (input.charCodeAt(input.length - 1) === C_NEWLINE) {
// ignore last blank line created by final newline
len -= 1;
}
+ if (this.options.time) { console.timeEnd("preparing input"); }
+ if (this.options.time) { console.time("block parsing"); }
for (var i = 0; i < len; i++) {
this.incorporateLine(lines[i], i + 1);
}