func (bA *Benchmark) Done(doneTime time.Duration, err error) {
	timeConsumed := uint64(doneTime.Nanoseconds())

	atomic.AddUint64(&bA.requestCounter, 1)

	bA.PrintStat()

	if err != nil {
		bA.errStat(err)
		atomic.AddUint64(&bA.errorRequestTimer, timeConsumed)

		if timeConsumed > bA.errorMaxReqTime {
			atomic.StoreUint64(&bA.errorMaxReqTime, timeConsumed)
		}

		if timeConsumed < bA.errorMinReqTime {
			atomic.StoreUint64(&bA.errorMinReqTime, timeConsumed)
		}
	} else {
		atomic.AddUint64(&bA.successRequestTimer, timeConsumed)
		atomic.AddUint64(&bA.successCounter, 1)

		if timeConsumed > bA.successMaxReqTime {
			atomic.StoreUint64(&bA.successMaxReqTime, timeConsumed)
		}

		if timeConsumed < bA.successMinReqTime {
			atomic.StoreUint64(&bA.successMinReqTime, timeConsumed)
		}
	}

	bA.waitGroup.Done()
}
//Done does all the operations & calculation required while ending a function call
Done does all the operations & calculation required while ending a function call
// Done does all the operations & calculation required while ending a function call
func (bA *Benchmark) Done(doneTime time.Duration, err error) {
	timeConsumed := uint64(doneTime.Nanoseconds())
	atomic.AddUint64(&bA.requestCounter, 1)
	bA.PrintStat()
	if err != nil {
		bA.errStat(err)
		atomic.AddUint64(&bA.errorRequestTimer, timeConsumed)
		if timeConsumed > bA.errorMaxReqTime {
			atomic.StoreUint64(&bA.errorMaxReqTime, timeConsumed)
		}
		if timeConsumed < bA.errorMinReqTime {
			atomic.StoreUint64(&bA.errorMinReqTime, timeConsumed)
		}
	} else {
		atomic.AddUint64(&bA.successRequestTimer, timeConsumed)
		atomic.AddUint64(&bA.successCounter, 1)
		if timeConsumed > bA.successMaxReqTime {
			atomic.StoreUint64(&bA.successMaxReqTime, timeConsumed)
		}
		if timeConsumed < bA.successMinReqTime {
			atomic.StoreUint64(&bA.successMinReqTime, timeConsumed)
		}
	}
	bA.waitGroup.Done()
}
func ( bA * Benchmark ) Done ( doneTime time . Duration , err error ) { timeConsumed := uint64 ( doneTime . Nanoseconds ( ) ) atomic . AddUint64 ( & bA . requestCounter , 1 ) bA . PrintStat ( ) if err != nil { bA . errStat ( err ) atomic . AddUint64 ( & bA . errorRequestTimer , timeConsumed ) if timeConsumed > bA . errorMaxReqTime { atomic . StoreUint64 ( & bA . errorMaxReqTime , timeConsumed ) } if timeConsumed < bA . errorMinReqTime { atomic . StoreUint64 ( & bA . errorMinReqTime , timeConsumed ) } } else { atomic . AddUint64 ( & bA . successRequestTimer , timeConsumed ) atomic . AddUint64 ( & bA . successCounter , 1 ) if timeConsumed > bA . successMaxReqTime { atomic . StoreUint64 ( & bA . successMaxReqTime , timeConsumed ) } if timeConsumed < bA . successMinReqTime { atomic . StoreUint64 ( & bA . successMinReqTime , timeConsumed ) } } bA . waitGroup . Done ( ) }
Done does all the operations & calculation required while ending a function call
Done does all the operations & calculation required while ending a function call