Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Weird behavior with the time command and background jobs



```
~
❯ f2() { eval "$@" & }

~
❯ time (f2 sleep 3 )
( f2 sleep 3; )  0.00s user 0.01s system 0% cpu 3.014 total

~
❯ f3() { (eval "$@" &) }

~
❯ time (f3 sleep 3)
( f3 sleep 3; )  0.00s user 0.00s system 41% cpu 0.007 total
```

Why is `f2` getting 3 seconds? It's running the job in the background, just like `f3`. In fact, their interactive behavior (without the time command) is the same.


Messages sorted by: Reverse Date, Date, Thread, Author