From 3bb150e5e689a6e58d485f2b87c15e38ccf50ae7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 10 Jan 2015 21:39:06 -0800 Subject: Timings: added 'preparing input'. --- js/lib/blocks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/lib') 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); } -- cgit v1.2.3