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 5:21 PM Sathish VJ <sath...@gmail.com > <javascript:>> 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 of microseconds or more. Meaning that for every 1 > nsec measured the code spends several thousans times more in the > non-measured path. So 1 sec / 1 nsec * theOverheadRatio is the time to read > 1 sec of _measured time. > > -- > > -j > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.