Skip to content

Commit a7b7b33

Browse files
committed
tweaking display to also show how long DOM manipulation took
1 parent af37486 commit a7b7b33

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

syntaxur/index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,15 @@ <h1>syntaxur</h1>
4545
html = Syntaxur.highlight(source);
4646
t2 = Date.now();
4747

48-
$("#time").text("Highlighting (not including DOM manipulation) took: " + (t2-t1) + "ms");
49-
$("code").html(html);
48+
$("#time").text("Highlighting (not including DOM manipulation) took: " + (t2-t1) + "ms. DOM manipulation...");
49+
50+
setTimeout(function(){
51+
t1 = Date.now();
52+
$("code").html(html);
53+
t2 = Date.now();
54+
55+
$("#time").text($("#time").text() + " took: " + (t2-t1) + "ms)");
56+
},50);
5057
},50);
5158
},500);
5259
});

0 commit comments

Comments
 (0)