summaryrefslogtreecommitdiff
path: root/benchmark/bm_require_thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/bm_require_thread.rb')
-rw-r--r--benchmark/bm_require_thread.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmark/bm_require_thread.rb b/benchmark/bm_require_thread.rb
new file mode 100644
index 0000000..e54db6c
--- /dev/null
+++ b/benchmark/bm_require_thread.rb
@@ -0,0 +1,15 @@
+$:.push File.join(File.dirname(__FILE__), "bm_require.data")
+
+i=0
+t = Thread.new do
+ while true
+ i = i+1 # dummy loop
+ end
+end
+
+1.upto(100) do |i|
+ require "c#{i}"
+end
+
+$:.pop
+t.kill