Skip to content

Commit

Permalink
r9
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 18, 2012
1 parent 5c03720 commit 256bd77
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 29 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
stats.js
========

#### Javascript Performance Monitor ####

#### JavaScript Performance Monitor ####

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

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

// Align top-left
stats.domElement.style.position = 'absolute';
stats.domElement.style.left = '0px';
stats.domElement.style.top = '0px';
stats.getDomElement().style.position = 'absolute';
stats.getDomElement().style.left = '0px';
stats.getDomElement().style.top = '0px';

parentElement.appendChild( stats.domElement );
document.body.appendChild( stats.getDomElement() );

setInterval( function () {

Expand All @@ -35,14 +34,21 @@ setInterval( function () {
}, 1000 / 60 );
```


### Bookmarklet ###

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


### Change Log ###

2012 01 18 - **r9** (2,872 KB, gzip: 1,038 B)

* Changed `.domElement` to `.getDomElement()`
* Added `.getFps()`, `.getFpsMin()`, `.getFpsMax()`, `.getMs()`, `.getMsMin()`, `.getMsMax()`.


2011 10 16 - **r8** (2.670 KB, gzip: 987 B)

* Performance and size optimizations.
Expand Down
13 changes: 6 additions & 7 deletions build/Stats.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 41 additions & 1 deletion src/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,47 @@ var Stats = function () {

return {

domElement: _container,
getDomElement: function () {

return _container;

},

getFps: function () {

return _fps;

},

getFpsMin: function () {

return _fpsMin;

},

getFpsMax: function () {

return _fpsMax;

},

getMs: function () {

return _ms;

},

getMsMin: function () {

return _msMin;

},

getMsMax: function () {

return _msMax;

},

update: function () {

Expand Down
21 changes: 11 additions & 10 deletions utils/builder.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import sys
import os

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

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

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

dep_file = open(output,'w');
dep_file.write(string);
dep_file.close();
file = open( build, 'w' )
file.write( header + contents )
file.close()
22 changes: 18 additions & 4 deletions utils/compiler/README
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ system have been added.

-----
Code in:
lib/libtrunk_rhino_parser_jarjared.jar
lib/rhino

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

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

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


-----
Expand Down Expand Up @@ -210,6 +209,21 @@ Description: Annotations for software defect detection.
Local Modifications: None.


-----
Code in:
lib/jarjar.jar

Jar Jar Links
URL: http://jarjar.googlecode.com/
Version: 1.1
License: Apache License 2.0

Description:
A utility for repackaging Java libraries.

Local Modifications: None.


----
Code in:
lib/junit.jar
Expand Down
Binary file modified utils/compiler/compiler.jar
Binary file not shown.

0 comments on commit 256bd77

Please sign in to comment.