Thank you Ian.
On Monday, 22 October 2018 21:46:44 UTC+5:30, Ian Davis wrote:
>
>
>
>
> On Mon, 22 Oct 2018, at 4:36 PM, Sathish VJ wrote:
>
> So, I also tried with
> *go test -v -bench=. -test.benchtime=0.1s *
> and that does complete.
>
> But is the implication that StopTimer/StartTimer is
On Mon, 22 Oct 2018, at 4:36 PM, Sathish VJ wrote:
> So, I also tried with
> *go test -v -bench=. -test.benchtime=0.1s *
> and that does complete.
>
> But is the implication that StopTimer/StartTimer is too costly to use
> even for this simple benchmark?
See
No, think about it...
If the setup time is 1 minute per iteration, and the timed activity is 1 usec
per iteration, then in order to time for 1 second the test would need to run
for a million minutes….
You need to restructure the test to avoid the setup on every test invocation.
> On Oct 22,
So, I also tried with
*go test -v -bench=. -test.benchtime=0.1s *
and that does complete.
But is the implication that StopTimer/StartTimer is too costly to use even
for this simple benchmark?
On Monday, 22 October 2018 21:00:20 UTC+5:30, Jan Mercl wrote:
>
>
>
>
> On Mon, Oct 22, 2018 at
On Mon, Oct 22, 2018 at 5:21 PM Sathish VJ wrote:
I believe it does actually end, it's just the timeout kicks in sooner.
The testing package attempts to make the benchmark run for at least 1 sec
by default, IINM. Your code has two parts. The measured one is like 1 nsec.
The non-measured is tens
Play Link: https://play.golang.org/p/YppC11kwyLz
Running this command hangs the program: go test -v -bench=.
*"*** Test killed with quit: ran too long (10m0s)."*
But if I comment out the stop/start timer, it is fine.
I tried both with go1.10 and go1.11. Same result.
I have no other file in