Suppose you are given a program, now you are given a task to minimize
the time, what will be your approach?
and how will you measure the time needed?
I think if we can get total clock cycle by any mean, that could be the
best measure. If so, how can I get that?
Suppose you are given a program, now you are given a task to minimize
the time, what will be your approach?
and how will you measure the time needed?
I think if we can get total clock cycle by any mean, that could be the
best measure. If so, how can I get that?
Suppose you are given a program, now you are given a task to minimize
the time, what will be your approach?
What time?
and how will you measure the time needed?
I think if we can get total clock cycle by any mean, that could be the
best measure. If so, how can I get that?
If you want to measure execution time of a Ruby program there's Benchmark.
To know where the program is looping the simplest way is to put several
"check points", some actions that should be executed before and after
suspicious code blocks. Those actions can be, for example, message
outputs or outputs of some variables that can cause looping.
Or you can use Ruby IDE that supports debugging where you can walk
through your code one command after another.
In the end of the program, the program never halts, I have no clue where
it is lopping, how can i know that? i mean the code block where it is
looping or getting stuck?
On Thu, Aug 9, 2012 at 11:26 PM, ajay paswan <lists@ruby-forum.com> wrote:
Then profile (you can do it using ruby-prof gem.)
In the end of the program, the program never halts, I have no clue where
it is lopping, how can i know that? i mean the code block where it is
looping or getting stuck?