简体   繁体   中英

How can I display own Events in Chrome dev tools

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?

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"); )

测量时间

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

分组

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

标记时间表

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM