javascript - How can I display own Events in Chrome dev tools - Stack Overflow

I would like to measure my application, which is very performance sensitive.To do so I would like to kn

I would like to measure my application, which is very performance sensitive.

To do so I would like to know if there is an option in the Chrome dev tools or in something else to get a view like it's provided in the Network Tab, but with my own, JS triggered events in it (like the red / blue line).

Is there a way to do so?

I would like to measure my application, which is very performance sensitive.

To do so I would like to know if there is an option in the Chrome dev tools or in something else to get a view like it's provided in the Network Tab, but with my own, JS triggered events in it (like the red / blue line).

Is there a way to do so?

Share Improve this question asked Aug 7, 2013 at 18:54 Daniel SchmidtDaniel Schmidt 11.9k5 gold badges42 silver badges73 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 13

The obvious solution is to use Console. It gives you much more tools than simple console.log:

  • Formatting (console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");)

  • Measuring time (console.time("Array initialize"); longRunningOperation(); console.timeEnd("Array initialize");)


(source: google.)

  • Grouping (console.group("Authenticating user '%s'", user); authentication(); console.groupEnd();)


(source: google.)

  • Marking events on the timeline (console.timeStamp("Adding result");)


(source: google.)

This should be more than enough to create readable log of custom events. See the official docs for more tips on using the Console.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744175795a4561746.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信