-
Notifications
You must be signed in to change notification settings - Fork 0
Perf
uupaa edited this page Aug 1, 2015
·
6 revisions
Perf オブジェクトは、WebModule 名前空間以下に配置(WebModule.Perf
)されています。
Perf.js を読み込む前に WebModule.publish = true;
を行うと、
Perf オブジェクトを GLOBAL 名前空間以下に直接配置 できます。
- new Perf - インスタンスを生成します
- 計測
- Perf#a - ポイントA を指定します
- Perf#b - ポイントB を指定します
- モニタ座標の変更
- Perf#x - パフォーマンスモニタの x 座標を設定/取得できます
- Perf#y - パフォーマンスモニタの y 座標を設定/取得できます
new Perf(options:Object = {}):Perf はインスタンスを作成し返します。
options には以下のプロパティを指定できます。
options | description |
---|---|
parentNode:Node = document.body | パフォーマンスモニタの親ノードを指定します |
x:Integer = 0 | パフォーマンスモニタのx座標(CSS::left)を指定します |
y:Integer = 0 | パフォーマンスモニタのy座標(CSS::left)を指定します |
color:ColorValueString = "hotpink" | fps と ms の表示色を指定します |
bgcolor:ColorValueString = "aliceblue" | パフォーマンスモニタの背景色を指定します |
opacity:Number = 0.7 | パフォーマンスモニタの opacity を指定します |
var perf = new Perf();
function loop() {
perf.a;
// your code here.
perf.b;
}
setInterval(loop, 16.666);