new Cesium.FrameRateMonitor(options)

Monitors the frame rate (frames per second) in a Scene and raises an event if the frame rate is 低于阈值。 后来,如果帧率恢复到所需的水平,则会单独提出一个事件. To avoid creating multiple FrameRateMonitors for a single Scene, use FrameRateMonitor.fromScene 而不是明确构建一个实例.
Name Type Description
options object optional 下列属性的对象 :
Name Type Default Description
scene Scene 用于监控性能的 NT 0 例.
samplingWindow number 5.0 optional 用来计算平均帧率的滑动窗口长度,以秒计.
quietPeriod number 2.0 optional The length of time to wait at startup and each time the page becomes visible (i.e. when the user switches back to the tab) before starting to measure performance, in seconds.
warmupPeriod number 5.0 optional 温暖期的长度,以秒计. 在暖和期,一个单独的 需要(通常较低)帧率.
minimumFrameRateDuringWarmup number 4 optional The minimum frames-per-second that are required for acceptable performance during 热身期。 如果在暖暖期的任何采样窗口中,帧率平均值低于此值,则 低FrameRate事件将被提升,页面将重定向到重定向OnLowFrameRateUrl,如果有的话.
minimumFrameRateAfterWarmup number 8 optional The minimum frames-per-second that are required for acceptable performance after 温暖期结束 如果在暖暖后的任何采样窗口中,帧率平均值低于此值,则 低FrameRate事件将被提升,页面将重定向到重定向OnLowFrameRateUrl,如果有的话.

Members

static Cesium.FrameRateMonitor.defaultSettings : object

The default frame rate monitoring settings. These settings are used when FrameRateMonitor.fromScene 需要创建一个新的帧速率显示器,对于未传递到 FrameRateMonitor constructor.

lastFramesPerSecond : number

Gets the most recently computed average frames-per-second over the last samplingWindow. 如果框架速率没有计算出来,则该属性可能未定义 .

lowFrameRate : Event

获取检测到低帧速率时提升的事件 。 此函数将被传递 the Scene instance as its first parameter and the average number of frames per second 作为第二个参数.

minimumFrameRateAfterWarmup : number

获取或设定可接受的性能所需的最小帧每秒 温暖期结束 如果在 NT 0 采样 Window NT 1 1 之后的 NT 2 暖气Period NT 3 期间,帧率平均值低于此,则 将提高 NT+0 lowFrameRate NT+1 事件,页面将重定向至 NT+2 重定向OnLowFrameRateUrl NT+3 ,如果有的话.

minimumFrameRateDuringWarmup : number

获取或设定可接受的性能所需的最小帧每秒 热身期。 如果在 NT 0 采样 Window NT 1 期间帧率平均值低于此,则 将提高 NT+0 lowFrameRate NT+1 事件,页面将重定向至 NT+2 重定向OnLowFrameRateUrl NT+3 ,如果有的话.

nominalFrameRate : Event

获取当帧率在低位后返回到正常水平时上升的事件. The function will be passed the Scene instance as its first parameter and the average 将采样窗口上的每秒帧数作为其第二个参数.

quietPeriod : number

Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user switches back to the tab) before starting to measure performance, in seconds.

samplingWindow : number

获取或设定用于计算平均帧率的滑动窗口长度,以秒计.

scene : Scene

Gets the Scene instance for which to monitor performance.

warmupPeriod : number

获得或设定暖期长度,以秒计. 在暖和期,一个单独的 需要(通常较低)帧率.

Methods

static Cesium.FrameRateMonitor.fromScene(scene)FrameRateMonitor

获得给定场景的 FrameRateMonitor . 如果现场还没有 a FrameRateMonitor ,一个与 FrameRateMonitor.defaultSettings 创建.
Name Type Description
scene Scene The scene for which to get the FrameRateMonitor.
Returns:
The scene's FrameRateMonitor.

destroy()

取消此实例来自它正在听的所有事件 . Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
See:

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
Returns:
如果此天体被销毁, 则属真; 否则, 属假 .
See:

pause()

Pauses monitoring of the frame rate. To resume monitoring, FrameRateMonitor#unpause 必须每次调用此函数一次.

unpause()

Resumes monitoring of the frame rate. If FrameRateMonitor#pause was called 多个次数,此函数必须称为相同次数,才能 实际恢复监控.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.