Current time: 02-26-2021, 02:48 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
W3C User Timing in Angular
03-01-2019, 02:12 AM
Post: #1
W3C User Timing in Angular
I am attempting to insert User Timing Marks into an Angular App. I want to measure when a content element on the page is displayed. For example, I'd like to find out when content ATF has rendered.

The content is within the app.component.html file so I thought that it made sense to place there. But it appears that when the page renders, the timing marks do not display when I look at the Chrome Dev tools timing area.

I am using the sample Angular setup page:

<!--The content below is only a placeholder and can be replaced.-->
<script>window.performance && performance.mark && performance.mark("ATFAreaBegin")</script>

<div style="text-align:center">
Test Page {{ title }}!

<h2>Here are some links to help you start: </h2>
<h2><a target="_blank" rel="noopener" href="">Tour of Heroes</a></h2>
<h2><a target="_blank" rel="noopener" href="">CLI Documentation</a></h2>
<h2><a target="_blank" rel="noopener" href="">Angular blog</a></h2>
<script>window.performance && performance.mark && performance.mark("ATFAreaEnd")</script>
<script>window.performance && performance.measure && performance.measure("ATFDuration", "ATFAreaBegin", "ATFAreEnd");</script>

At a basic level, does anyone have any example of how to accomplish this in Angular? I haven't been able to find any documentation with a specific example. Any marks within the index.html page are output.

Any information would really be helpful.
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)