Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: sky/benchmarks/resources/runner.sky

Issue 701813004: Add a microbenchmark for simple block layout (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fixenated Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/benchmarks/layout/simple-blocks.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/benchmarks/resources/runner.sky
diff --git a/sky/benchmarks/resources/runner.sky b/sky/benchmarks/resources/runner.sky
index eaa1059e0715c5fba03495128790cf1e888788f4..e307c0d2732923a0eedfd0fc7814401ba5d0dc49 100644
--- a/sky/benchmarks/resources/runner.sky
+++ b/sky/benchmarks/resources/runner.sky
@@ -3,6 +3,7 @@ function PerfRunner(options) {
this.unit_ = options.unit || "ms";
this.iterationsRemaining_ = options.iterations || 10;
this.results_ = [];
+ this.setup_ = options.setup;
}
PerfRunner.prototype.log = function(line) {
@@ -17,9 +18,15 @@ PerfRunner.prototype.recordResult = function(result) {
PerfRunner.prototype.runAsync = function(test) {
var self = this;
window.setTimeout(function() {
+ if (self.setup_) {
+ var setup = self.setup_;
+ setup();
+ }
+
var startTime = Date.now();
test(function() {
var endTime = Date.now();
+
self.recordResult(endTime - startTime);
if (--self.iterationsRemaining_ > 0)
self.runAsync(test);
« no previous file with comments | « sky/benchmarks/layout/simple-blocks.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698