Skip to content
Snippets Groups Projects
Select Git revision
  • 1ad3ced2504b56dcdf07d3e387482e71aed40fe6
  • without_tipselection default
  • develop protected
  • fix/grafana-local-dashboard
  • wasp
  • fix/dashboard-explorer-freeze
  • master
  • feat/timerqueue
  • test/sync_debug_and_650
  • feat/sync_revamp_inv
  • wip/sync
  • tool/db-recovery
  • portcheck/fix
  • fix/synchronization
  • feat/new-dashboard-analysis
  • feat/refactored-analysis-dashboard
  • feat/new-analysis-dashboard
  • test/demo-prometheus-fpc
  • prometheus_metrics
  • wip/analysis-server
  • merge/fpc-test-value-transfer
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

workerpool_test.go

Blame
  • workerpool_test.go 330 B
    package workerpool
    
    import (
    	"sync"
    	"testing"
    )
    
    func Benchmark(b *testing.B) {
    	pool := New(func(task Task) {
    		task.Return(task.Param(0))
    	}, WorkerCount(10), QueueSize(2000))
    	pool.Start()
    
    	var wg sync.WaitGroup
    	for i := 0; i < b.N; i++ {
    		wg.Add(1)
    
    		go func() {
    			<-pool.Submit(i)
    
    			wg.Done()
    		}()
    	}
    
    	wg.Wait()
    }