code: func getStopTimeout() time.Duration {
  	// For default and paths see https://support.microsoft.com/en-us/kb/146092
  	defaultTimeout := time.Millisecond * 20000
  	key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\CurrentControlSet\Control`, registry.READ)
  	if err != nil {
  		return defaultTimeout
  	}
  	sv, _, err := key.GetStringValue("WaitToKillServiceTimeout")
  	if err != nil {
  		return defaultTimeout
  	}
  	v, err := strconv.Atoi(sv)
  	if err != nil {
  		return defaultTimeout
  	}
  	return time.Millisecond * time.Duration(v)
  }
docs: // getStopTimeout fetches the time before windows will kill the service.