use elapsed macro rather than timing for loop, also allow seconds

This seems like it may be "fairer", though I'm not sure if it is more accurate or not. Thought I should throw it out there.

*There is also printing in seconds (if it takes that long).*
Thanks for the PR! I'm actually traveling for the next week and a half, but
I'll be sure to have a look at this when I'm back.

Regarding type inference on "val", I'm most worried about the whole macro
being in global scope. I'm not sure I did that right. Might be better to
have the macro define a function and immediately call it.
On Jul 18, 2014 7:02 PM, "Andy Hayden" <notifications@github.com> wrote:

> In src/TimeIt.jl:
>
> >          for i = 1:$(esc(n))
> > -            local val = $(esc(ex))
> > +            # already warm
> > +            total += @elapsed $(esc(ex))
>
> Ag. in retrospect this is obviously not going to be as accurate (as there
> is an accuracy limit which is avoided using the for loop). Saying that, we
> can still use @elapsed here (but over the for loop), will update. One
> point to mention is the type inference of val - that could slows things
> down. :s
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/kbarbary/TimeIt.jl/pull/1/files#r15121726>.
>