Options
All
  • Public
  • Public/Protected
  • All
Menu

通过使用这个类,您可以直观地找到瓶颈和基本的CPU使用情况。

Hierarchy

  • TimeRuler

Index

Constructors

constructor

Properties

Private _frameAdjust

_frameAdjust: number

Private _markerNameToIdMap

_markerNameToIdMap: Map<string, number> = new Map<string, number>()

从标记名映射到标记id的字典。

Private _position

_position: Vector2

TimerRuler画的位置。

Private _rectShape1

_rectShape1: Shape = new egret.Shape()

画透明背景

Private _rectShape2

_rectShape2: Shape = new egret.Shape()

Private _rectShape3

_rectShape3: Shape = new egret.Shape()

Private _rectShape4

_rectShape4: Shape = new egret.Shape()

Private _rectShape5

_rectShape5: Shape = new egret.Shape()

Private _rectShape6

_rectShape6: Shape = new egret.Shape()

Private _updateCount

_updateCount: number

你想在游戏开始时调用StartFrame更新方法。 当游戏在固定时间步进模式下运行缓慢时,更新会多次调用。 在这种情况下,我们应该忽略StartFrame调用。 为此,我们只需一直跟踪StartFrame调用的次数,直到Draw被调用。

Private curLog

curLog: FrameLog

当前帧日志

enabled

enabled: true

Private frameCount

frameCount: number

当前帧数量

logs

logs: FrameLog[]

每帧的日志

Private markers

markers: MarkerInfo[] = []

Private prevLog

prevLog: FrameLog

上一帧日志

Private sampleFrames

sampleFrames: number

当前显示帧计数

showLog

showLog: boolean = false

获取/设置日志显示或否

Private stopwacth

stopwacth: Stopwatch = new stopwatch.Stopwatch()

秒表用来测量时间。

targetSampleFrames

targetSampleFrames: number

获取/设置目标样本帧。

width

width: number

获取/设置计时器标尺宽度。

Static Private _instance

_instance: any

Static Readonly autoAdjustDelay

autoAdjustDelay: 30 = 30

Static Readonly barHeight

barHeight: 8 = 8

条的高度(以像素为单位)

Static Readonly barPadding

barPadding: 2 = 2

Static Readonly logSnapDuration

logSnapDuration: 120 = 120

持续时间(帧数)为采取抓拍日志。

Static Readonly maxBars

maxBars: 8 = 8

最大条数 8

Static Readonly maxNestCall

maxNestCall: 32 = 32

每条的最大嵌套调用

Static Readonly maxSampleFrames

maxSampleFrames: 4 = 4

最大显示帧

Static Readonly maxSamples

maxSamples: 256 = 256

Accessors

Static Instance

Methods

beginMark

  • beginMark(markerName: string, color: number, barIndex?: number): void

endMark

  • endMark(markerName: string, barIndex?: number): void

getAverageTime

  • getAverageTime(barIndex: number, markerName: string): number

Private onGraphicsDeviceReset

  • onGraphicsDeviceReset(): void

render

  • render(position?: Vector2, width?: number): void

resetLog

  • resetLog(): void

startFrame

  • startFrame(): void

Generated using TypeDoc