Sha256: 7c0359982eaf3b1fb077bbafe54fb374a2bf941079dd93029010c6dfaeb32c31
Contents?: true
Size: 594 Bytes
Versions: 23
Compression:
Stored size: 594 Bytes
Contents
require 'rubygems' $LOAD_PATH.unshift("xampl_generated_code") require 'TokyoCabinetExperimental' Xampl.set_default_persister_kind(:tokyo_cabinet) Xampl.set_default_persister_format(:xml_format) module TokyoCabinetExperimental start = Time.now people = nil Xampl.transaction("setup") do people = People['people'] end loop_start = Time.now total = 0 people.person.each do | person | age = person.age.to_i total += age end done = Time.now puts "Total age: #{ total }" puts "done: #{ done - start }:: #{ loop_start - start} + #{ done - loop_start}" end
Version data entries
23 entries across 23 versions & 2 rubygems