func (bA *Benchmark) Run(fn func() error) {
	bA.benchStart = time.Now()
	fmt.Println(
		"\nDuration              :", time.Millisecond*time.Duration(bA.BenchDuration),
		"\nTotal requests        :", bA.TotalRequests,
		"\nWait time per request :", bA.WaitPerReq,
		"\nShow progess          :", bA.ShowProgress,
		", per", bA.StatReqCount, "request(s)",
		"\nStart                 :", bA.benchStart,
	)

	for i := uint64(0); i < bA.TotalRequests; i++ {
		go func() {
			startTime := time.Now()
			err := fn()
			bA.Done(time.Since(startTime), err)
		}()
		time.Sleep(bA.WaitPerReq)
	}

	bA.Final()
}
//Run runs the benchmark for the given function
Run runs the benchmark for the given function
// Run runs the benchmark for the given function
func (bA *Benchmark) Run(fn func() error) {
	bA.benchStart = time.Now()
	fmt.Println(
		"\nDuration              :", time.Millisecond*time.Duration(bA.BenchDuration),
		"\nTotal requests        :", bA.TotalRequests,
		"\nWait time per request :", bA.WaitPerReq,
		"\nShow progess          :", bA.ShowProgress,
		", per", bA.StatReqCount, "request(s)",
		"\nStart                 :", bA.benchStart,
	)
	for i := uint64(0); i < bA.TotalRequests; i++ {
		go func() {
			startTime := time.Now()
			err := fn()
			bA.Done(time.Since(startTime), err)
		}()
		time.Sleep(bA.WaitPerReq)
	}
	bA.Final()
}
func ( bA * Benchmark ) Run ( fn func ( ) error ) { bA . benchStart = time . Now ( ) fmt . Println ( " \n " , time . Millisecond * time . Duration ( bA . BenchDuration ) , " \n " , bA . TotalRequests , " \n " , bA . WaitPerReq , " \n " , bA . ShowProgress , " " , bA . StatReqCount , " " , " \n " , bA . benchStart , ) for i := uint64 ( 0 ) ; i < bA . TotalRequests ; i ++ { go func ( ) { startTime := time . Now ( ) err := fn ( ) bA . Done ( time . Since ( startTime ) , err ) } ( ) time . Sleep ( bA . WaitPerReq ) } bA . Final ( ) }
Run runs the benchmark for the given function
Run runs the benchmark for the given function