summaryrefslogtreecommitdiffstats
path: root/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js')
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js b/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js
new file mode 100644
index 0000000000..2547a1a010
--- /dev/null
+++ b/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js
@@ -0,0 +1,11 @@
+// Use some CPU.
+var interval = window.setInterval(() => {
+ // Compute an arbitrary value, print it out to make sure that the JS
+ // engine doesn't discard all our computation.
+ var date = Date.now();
+ var array = [];
+ var i = 0;
+ while (Date.now() - date <= 100) {
+ array[i % 2] = i++;
+ }
+}, 300);