Last active
March 19, 2018 22:17
-
-
Save sancarn/3d22cf8cd80ea1f6b38b6d957e772e10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Time taken: 23.347s (response = 535 model objects, ran immediately after opening Database) | |
t1 = Time.now | |
$dbListPaths="" | |
def walk(moc) | |
moc.each do |mo| | |
$dbListPaths += mo.path + "\n" | |
walk(mo.children) | |
end | |
end | |
root_objects = WSApplication.current_database.root_model_objects | |
walk(root_objects) | |
t2 = Time.now | |
puts "Time taken: #{t2-t1}" | |
puts $dbListPaths | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Time taken: 2.772s (response = 535 model objects, ran immediately after opening Database) | |
t1 = Time.now | |
$dbListCounter=0 | |
$dbListPaths="" | |
def walk(moc) | |
$dbListCounter+=1 | |
moc.each do |mo| | |
$dbListPaths += mo.path + "\n" | |
Thread.new{walk(mo.children)} | |
end | |
$dbListCounter-=1 | |
end | |
root_objects = WSApplication.current_database.root_model_objects | |
walk(root_objects) | |
sleep(0.1) until $dbListCounter==0 | |
t2 = Time.now | |
puts "Time taken: #{t2-t1}" | |
puts $dbListPaths | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment