Skip to content

Commit 256bd77

Browse files
committed
r9
1 parent 5c03720 commit 256bd77

File tree

6 files changed

+89
-29
lines changed

6 files changed

+89
-29
lines changed

README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
stats.js
22
========
33

4-
#### Javascript Performance Monitor ####
5-
4+
#### JavaScript Performance Monitor ####
65

76
This class provides a simple info box that will help you monitor your code performance.
87

@@ -22,11 +21,11 @@ This class provides a simple info box that will help you monitor your code perfo
2221
var stats = new Stats();
2322

2423
// Align top-left
25-
stats.domElement.style.position = 'absolute';
26-
stats.domElement.style.left = '0px';
27-
stats.domElement.style.top = '0px';
24+
stats.getDomElement().style.position = 'absolute';
25+
stats.getDomElement().style.left = '0px';
26+
stats.getDomElement().style.top = '0px';
2827

29-
parentElement.appendChild( stats.domElement );
28+
document.body.appendChild( stats.getDomElement() );
3029

3130
setInterval( function () {
3231

@@ -35,14 +34,21 @@ setInterval( function () {
3534
}, 1000 / 60 );
3635
```
3736

37+
3838
### Bookmarklet ###
3939

40-
Albeit theorically not as accurate the widget can also be easily inserted to **any site** using the bookmarklet.
40+
Albeit theorically not as accurate the widget can also be easily inserted to **any site** using a bookmarklet.
4141
[Follow the instructions](http://mrdoob.com/blog/post/707).
4242

4343

4444
### Change Log ###
4545

46+
2012 01 18 - **r9** (2,872 KB, gzip: 1,038 B)
47+
48+
* Changed `.domElement` to `.getDomElement()`
49+
* Added `.getFps()`, `.getFpsMin()`, `.getFpsMax()`, `.getMs()`, `.getMsMin()`, `.getMsMax()`.
50+
51+
4652
2011 10 16 - **r8** (2.670 KB, gzip: 987 B)
4753

4854
* Performance and size optimizations.

build/Stats.js

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Stats.js

+41-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,47 @@ var Stats = function () {
116116

117117
return {
118118

119-
domElement: _container,
119+
getDomElement: function () {
120+
121+
return _container;
122+
123+
},
124+
125+
getFps: function () {
126+
127+
return _fps;
128+
129+
},
130+
131+
getFpsMin: function () {
132+
133+
return _fpsMin;
134+
135+
},
136+
137+
getFpsMax: function () {
138+
139+
return _fpsMax;
140+
141+
},
142+
143+
getMs: function () {
144+
145+
return _ms;
146+
147+
},
148+
149+
getMsMin: function () {
150+
151+
return _msMin;
152+
153+
},
154+
155+
getMsMax: function () {
156+
157+
return _msMax;
158+
159+
},
120160

121161
update: function () {
122162

utils/builder.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import sys
21
import os
32

4-
rev = 8;
5-
output = '../build/Stats.js';
6-
string = "// stats.js r" + str(rev) + " - http://github.com/mrdoob/stats.js\n";
3+
rev = 9
4+
source = '../src/Stats.js'
5+
build = '../build/Stats.js'
6+
header = '// stats.js r' + str( rev ) + ' - http://github.com/mrdoob/stats.js\n'
77

8-
os.system("java -jar compiler/compiler.jar --language_in=ECMASCRIPT5 --js ../src/Stats.js --js_output_file ../build/Stats.js");
8+
os.system( 'java -jar compiler/compiler.jar --language_in=ECMASCRIPT5 --js ' + source + ' --js_output_file ' + build )
99

10-
src_file = open(output,'r');
11-
string += src_file.read() + "\n";
10+
file = open( build, 'r' )
11+
contents = file.read();
12+
file.close()
1213

13-
dep_file = open(output,'w');
14-
dep_file.write(string);
15-
dep_file.close();
14+
file = open( build, 'w' )
15+
file.write( header + contents )
16+
file.close()

utils/compiler/README

+18-4
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ system have been added.
152152

153153
-----
154154
Code in:
155-
lib/libtrunk_rhino_parser_jarjared.jar
155+
lib/rhino
156156

157157
Rhino
158158
URL: http://www.mozilla.org/rhino
@@ -161,9 +161,8 @@ License: Netscape Public License and MPL / GPL dual license
161161

162162
Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
163163

164-
Local Modifications: None. We've used JarJar to renamespace the code
165-
post-compilation. See:
166-
http://code.google.com/p/jarjar/
164+
Local Modifications: Minor changes to parsing JSDoc that usually get pushed
165+
up-stream to Rhino trunk.
167166

168167

169168
-----
@@ -210,6 +209,21 @@ Description: Annotations for software defect detection.
210209
Local Modifications: None.
211210

212211

212+
-----
213+
Code in:
214+
lib/jarjar.jar
215+
216+
Jar Jar Links
217+
URL: http://jarjar.googlecode.com/
218+
Version: 1.1
219+
License: Apache License 2.0
220+
221+
Description:
222+
A utility for repackaging Java libraries.
223+
224+
Local Modifications: None.
225+
226+
213227
----
214228
Code in:
215229
lib/junit.jar

utils/compiler/compiler.jar

912 KB
Binary file not shown.

0 commit comments

Comments
 (0)