I'm using MongoDB for the first time and trying to time its performance. I'm running ruby on a VirtualBox Ubuntu 9.10 guest with a Windows 7 64-bit host. MongoDB is on a remote host, not on my lan buit somewhere in the internet cloud.
Here's my code:
time1 = Time.now
rows = coll.find(some_criteria)
puts ((Time.now - time1) * 1000).to_s
The problem is, the time is so small, I don't believe what I'm seeing. I'm seeing times around 50, 100, 200 MICROseconds, while ping times between my computer and the remote mongo computer are around 40 MILLIseconds. Am I misunderstanding the units? How can my timings be so low when the ping is so high?