func (s Stopwatch) Run(args []string) int {
	fmt.Fprintln(out, "Starting stopwatch")

	interval, err := time.ParseDuration("10ms")
	if err != nil {
		fmt.Fprintf(out, "Failed to parse interval: %v", err)
		return command.RESULT_INTERNAL_ERROR
	}

	// Check for input in the background
	go func() {
		scanner := bufio.NewScanner(in)

		for scanner.Scan() {
			text := scanner.Text()
			if text == "q" {
				isRunning = false
				break
			}

			fmt.Fprintf(out, "INPUT: %v\n", text)
		}
	}()

	runStopwatch(interval)
	return command.RESULT_SUCCESS
}
// Run starts the stopwatch.
Run starts the stopwatch.
// Run starts the stopwatch .
func (s Stopwatch) Run(args []string) int {
	fmt.Fprintln(out, "Starting stopwatch")
	interval, err := time.ParseDuration("10ms")
	if err != nil {
		fmt.Fprintf(out, "Failed to parse interval: %v", err)
		return command.RESULT_INTERNAL_ERROR
	}
	go func() {
		scanner := bufio.NewScanner(in)
		for scanner.Scan() {
			text := scanner.Text()
			if text == "q" {
				isRunning = false
				break
			}
			fmt.Fprintf(out, "INPUT: %v\n", text)
		}
	}()
	runStopwatch(interval)
	return command.RESULT_SUCCESS
}
func ( s Stopwatch ) Run ( args [ ] string ) int { fmt . Fprintln ( out , " " ) interval , err := time . ParseDuration ( " " ) if err != nil { fmt . Fprintf ( out , " " , err ) return command . RESULT_INTERNAL_ERROR } go func ( ) { scanner := bufio . NewScanner ( in ) for scanner . Scan ( ) { text := scanner . Text ( ) if text == " " { isRunning = false break } fmt . Fprintf ( out , " \n " , text ) } } ( ) runStopwatch ( interval ) return command . RESULT_SUCCESS }
Run starts the stopwatch.
Run starts the stopwatch .
// Check for input in the background