Skip to content
DebugUtil

工具 / DebugUtil

DebugUtil Class
​

游戏性能数据,辅助 Debug 和性能优化

Table of contents ​

Properties
​

tsEventRpcFuncs: string[]

Accessors
​

cachedRPCs(): string[]
当前帧缓存的RPC消息。
frameTime(): number
帧时间是生成一帧游戏内容所花费的总时间。由于游戏线程和渲染线程在完成一帧之前保持同步,帧时往往接近其中一个线程中显示的时间。单位ms
gameThreadTime(): number
对象在游戏线程中消耗的时间,包括脚本,动画,游戏逻辑等。单位ms。如果帧时接近游戏线程中显示的时间,则游戏的性能很可能会受到游戏线程的阻碍。单位ms。
receivedBytes(): number
一秒内收到的网络包的总大小。单位 Byte。
receivedRPCs(): string[]
当前帧收到的RPC消息。
renderThreadTime(): number
在渲染线程中处理这些对象的时间,受粒子,特效,网格等影响。单位ms。
sentBytes(): number
一秒内发出的网络包的总大小。单位 Byte
sentRPCs(): string[]
当前帧发送的RPC消息。
usedMemory(): number
当前使用的总内存大小,单位MB。

Properties ​

tsEventRpcFuncs
​

▪ Static tsEventRpcFuncs: string[]

Accessors ​

cachedRPCs
​

• Static get cachedRPCs(): string[]

当前帧缓存的RPC消息。

Returns ​

string[]

frameTime
​

• Static get frameTime(): number

帧时间是生成一帧游戏内容所花费的总时间。由于游戏线程和渲染线程在完成一帧之前保持同步,帧时往往接近其中一个线程中显示的时间。单位ms

Returns ​

number

gameThreadTime
​

• Static get gameThreadTime(): number

对象在游戏线程中消耗的时间,包括脚本,动画,游戏逻辑等。单位ms。如果帧时接近游戏线程中显示的时间,则游戏的性能很可能会受到游戏线程的阻碍。单位ms。

Returns ​

number

receivedBytes
​

• Static get receivedBytes(): number

一秒内收到的网络包的总大小。单位 Byte。

Returns ​

number

receivedRPCs
​

• Static get receivedRPCs(): string[]

当前帧收到的RPC消息。

Returns ​

string[]

renderThreadTime
​

• Static get renderThreadTime(): number

在渲染线程中处理这些对象的时间,受粒子,特效,网格等影响。单位ms。

Precautions

如果帧时接近Draw线程中显示的时间,则游戏的性能很可能会受到渲染线程的阻碍。单位ms。服务端该值为0。

Returns ​

number

sentBytes
​

• Static get sentBytes(): number

一秒内发出的网络包的总大小。单位 Byte

Returns ​

number

sentRPCs
​

• Static get sentRPCs(): string[]

当前帧发送的RPC消息。

Returns ​

string[]

usedMemory
​

• Static get usedMemory(): number

当前使用的总内存大小,单位MB。

Returns ​