[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04193] RE: How-to time short intervals?

From: hal9000@...
Date: 2000-07-24 16:44:19 UTC
List: ruby-talk #4193
> Ok, so we can't hope for anything better than secs/millisecs without
going
> platform-specific then. Point taken on relying on anything less than
secs.
> However I'm not relying on them for any critical func; I'm writing
some
> performance tests.

Robert,

Maybe there's some reason you don't want to do this, but my suggestion
would be to put the part you're timing in a huge loop. (Of course,
that introduces a slight inaccuracy because of the loop processing
overhead.)

For example, run your code 100,000 times and divide the runtime by
100,000.

Just a thought.

Hal

--
Hal Fulton


Sent via Deja.com http://www.deja.com/
Before you buy.

In This Thread

Prev Next