Implementation:SeleniumHQ Selenium Closure Testing PerformanceTimer
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing performance timing utilities for benchmarking test functions, used by Selenium JavaScript atoms.
Description
goog.testing.PerformanceTimer is a vendored copy of the Google Closure Library module. It runs test functions a configurable number of times to generate timing samples and computes performance statistics including minimum, maximum, average, and standard deviation. It supports configurable sample counts, timeout intervals, outlier discarding, and uses high-resolution performance.now() when available. Selenium uses this as part of its JavaScript atom infrastructure.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/testing/performancetimer.js
- Lines: 1-444
Key Exports
goog.provide('goog.testing.PerformanceTimer');
goog.provide('goog.testing.PerformanceTimer.Task');
goog.testing.PerformanceTimer = function(opt_numSamples, opt_timeoutInterval) { ... };
// Default: 10 samples, 5000ms timeout
goog.testing.PerformanceTimer.now_ = function() { ... };
goog.testing.PerformanceTimer.prototype.getNumSamples = function() { ... };