Skip to content

Instantly share code, notes, and snippets.

@moustaki
Created January 22, 2010 13:43
Show Gist options
  • Save moustaki/283765 to your computer and use it in GitHub Desktop.
Save moustaki/283765 to your computer and use it in GitHub Desktop.
require 'rubygems'
require '4store-ruby'
query = ARGV[0]
class Array; def sum; inject( nil ) { |sum,x| sum ? sum+x : x }; end; end
class Array; def mean; sum / size; end; end
store = FourStore::Store.new 'http://kakapo.dcs.qmul.ac.uk/bbc/programmes/sparql/'
results = []
t = []
50.times do
a = Time.now
t = store.select query
b = Time.now
results << b - a
end
puts "Got #{t.size} results"
puts results.mean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment