/**

cpuhog starts an HTTP server on 8080 that occupies the CPU for 2 seconds
for every request it receives.

For demo purposes only.

**/
cpuhog starts an HTTP server on 8080 that occupies the CPU for 2 seconds
for every request it receives.

For demo purposes only.
/ ** cpuhog starts an HTTP server on 8080 that occupies the CPU for 2 seconds for every request it receives . For demo purposes only . ** /
func occupyCPU () string {
  start := time.Now()
  second, _ := time.ParseDuration("1000ms")
  end := start.Add(second)
  i := 0
  for time.Now().Before(end) {
    i = i + 1
  }
  return fmt.Sprintf("%d", i)
}
func occupyCPU ( ) string { start := time . Now ( ) second , _ := time . ParseDuration ( " " ) end := start . Add ( second ) i := 0 for time . Now ( ) . Before ( end ) { i = i + 1 } return fmt . Sprintf ( " " , i ) }
cpuhog starts an HTTP server on 8080 that occupies the CPU for 2 seconds
for every request it receives.
cpuhog starts an HTTP server on 8080 that occupies the CPU for 2 seconds for every request it receives .