Guest User

Untitled

a guest
Jun 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1.  
  2. puts
  3. puts RUBY_VERSION
  4. puts
  5.  
  6. require 'rubygems'
  7. require 'benchmark'
  8. require 'fileutils'
  9. require 'ruote' # gem install ruote
  10. require 'ruote/storage/fs_storage'
  11.  
  12. FileUtils.rmdir('bench')
  13.  
  14. engine = Ruote::Engine.new(Ruote::FsStorage.new('bench'))
  15.  
  16. pdef = Ruote.process_definition do
  17. alpha :task => 'walk the dog'
  18. alpha :task => 'walk the dog'
  19. alpha :task => 'walk the dog'
  20. alpha :task => 'walk the dog'
  21. alpha :task => 'walk the dog'
  22. alpha :task => 'walk the dog'
  23. alpha :task => 'walk the dog'
  24. alpha :task => 'walk the dog'
  25. alpha :task => 'walk the dog'
  26. alpha :task => 'walk the dog'
  27. end
  28.  
  29. Benchmark.benchmark(' ' * 31 + Benchmark::Tms::CAPTION, 31) do |b|
  30. b.report('1000 launches') do
  31. 1000.times { engine.launch(pdef) }
  32. end
  33. end
Add Comment
Please, Sign In to add comment