changeset 23788:316ad725a1dd

perf: add a configurable sleep on startup This is intended to counteract power management by giving a consistent idle period before test runs.
author Matt Mackall <mpm@selenic.com>
date Sat, 10 Jan 2015 21:13:10 -0600
parents 678f53865c68
children 94951db84fc0
files contrib/perf.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Thu Jan 08 00:01:03 2015 +0100
+++ b/contrib/perf.py	Sat Jan 10 21:13:10 2015 -0600
@@ -14,6 +14,10 @@
 
     This functions exist to gather the creation of formatter in a single
     place instead of duplicating it in all performance command."""
+
+    # enforce an idle period before execution to counteract power management
+    time.sleep(ui.configint("perf", "presleep", 1))
+
     if opts is None:
         opts = {}
     # redirect all to stderr