Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Start starts the worker pool process
  2. func (m *Pool) Start(resources []interface{}, procFunc ProcessorFunc, resFunc ResultProcessorFunc) {
  3. log.DEBUG.Print("worker pool starting")
  4. startTime := time.Now()
  5. go m.allocate(resources)
  6. m.done = make(chan bool)
  7. go m.collect(resFunc)
  8. go m.workerPool(procFunc)
  9. <-m.done
  10. endTime := time.Now()
  11. diff := endTime.Sub(startTime)
  12. log.DEBUG.Printf("total time taken: [%f] seconds", diff.Seconds())
  13. }
Add Comment
Please, Sign In to add comment