console API takes a long time

4 views
Skip to first unread message

Sean Young

unread,
Mar 17, 2014, 9:16:29 PM3/17/14
to node-...@googlegroups.com
I found that console API takes a very long time to execute on my computer.

have a try : )

var now = Date.now();console.log(window);console.log(window);console.log(window);alert((Date.now()-now)/1000);

env:
Win7 - 64bits
node-webkit v0.9.2

with node-webkit 0.9.2 it alerts ~0.35s
even if you don't open devtools, result is the same.

Laszlo Z. Antal

unread,
Mar 17, 2014, 9:46:10 PM3/17/14
to node-...@googlegroups.com
Hi,
Try logging it to the console instead. That 350ms includes the creation and showing of the alert dialog. 

Laszlo
http://twitter.com/LZAntal

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Young

unread,
Mar 18, 2014, 1:42:07 AM3/18/14
to node-...@googlegroups.com
Thanks Antal. But the result is also the same. This expression((Date.now()-now)/1000) calculates earlier than alert so I think it makes no difference whether using alert or console.

I've tested this with chrome and node-webkit v0.7.5 and both ran well.

I found this by noticing the UI thread was blocked somehow and finally figured out what caused it.
Reply all
Reply to author
Forward
0 new messages