Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 550e5f8

Browse files
committed
change from using console to printing the timing data onto the screen
1 parent 60eeeb9 commit 550e5f8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

perf/buzz.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<link rel="stylesheet" type="text/css" href="buzz.css"/>
55
<script type="text/javascript">
6+
var log = [];
67
function time(timerName){
78
var started = new Date().getTime();
89
return {
@@ -15,7 +16,7 @@
1516
var lapDuration = this.lapped - this.lastLap.time;
1617
var lastName = this.lastLap.name;
1718
this.lastLap = {duration:lapDuration, name:lapName, time:this.lapped};
18-
console.log(timerName, lapName + ': ' + this.lastLap.duration + ' ms.', '(' + totalDuration + ' ms.)');
19+
log.push(timerName + ' ' + lapName + ': ' + this.lastLap.duration + ' ms. (' + totalDuration + ' ms.)');
1920
}
2021
};
2122
}
@@ -24,10 +25,11 @@
2425
<script type="text/javascript" src="../angular-minified.js" ng:autobind ng:css="css/angular.css"></script>
2526
<script type="text/javascript">
2627
window.browser.lap('parse <angular/>');
27-
function onInit() {
28+
function onInit(scope) {
2829
window.browser.lap('compile DOM');
2930
window.setTimeout(function(){
3031
window.browser.lap('DOM render');
32+
scope.$eval();
3133
}, 1);
3234
}
3335
</script>
@@ -39,8 +41,9 @@
3941
window.browser.lap('parse model');
4042
</script>
4143
</head>
42-
<body ng:init="$window.$scope = this;$window.onInit(); activities = $window.googlebuzz" style="display:none;" ng:show="true">
43-
<a href="{{$location.href}}">reload</a>
44+
<body ng:init="$window.$scope = this;$window.onInit(this); activities = $window.googlebuzz; log = $window.log" style="display:none;" ng:show="true">
45+
<a href="{{$location.href}}">reload</a><br/>
46+
<tt ng:repeat="line in log">{{line}}<br/></tt>
4447
<hr/>
4548
<div>
4649
<span>&lt;angular/&gt; Buzz</span>

0 commit comments

Comments
 (0)