git://git.onelab.eu
/
tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8751835
)
Runs a spinloop, used for CPU scheduler testing
author
Andy Bavier
<acb@cs.princeton.edu>
Tue, 29 Jan 2008 20:47:42 +0000
(20:47 +0000)
committer
Andy Bavier
<acb@cs.princeton.edu>
Tue, 29 Jan 2008 20:47:42 +0000
(20:47 +0000)
qaapi/qa/tests/busyloop.py
[new file with mode: 0755]
patch
|
blob
diff --git a/qaapi/qa/tests/busyloop.py
b/qaapi/qa/tests/busyloop.py
new file mode 100755
(executable)
index 0000000..
8cff8a5
--- /dev/null
+++ b/
qaapi/qa/tests/busyloop.py
@@ -0,0
+1,14
@@
+#!/usr/bin/python
+
+import sys
+import time
+
+def main(sec):
+ now = time.time()
+ stop = now + float(sec)
+ print 'about to busy-wait for', sec, 'seconds'
+ while now < stop:
+ now = time.time()
+
+if __name__ == "__main__":
+ main(sys.argv[1])