find out the time used for searching a file

L

Li Chen

Hi all,

When I run a script to search some files in a folder and/or its children
folders I want know how long it takes when the search is done. Is there
any such method available in Ruby ?

Thanks,

Li
 
P

Phrogz

Li said:
When I run a script to search some files in a folder and/or its children
folders I want know how long it takes when the search is done. Is there
any such method available in Ruby ?

a) Research the Benchmark library
b)
start_time = Time.new
# do stuff here
end_time = Time.new
puts( "It took #{end_time - start_time} seconds" )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top