Question: All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this?

Answer: 
Bash is a programming (scripting) language, but it's also a shell and a user-interface. If `0` was error, then the program could only present one kind of error.

However in Bash, any nonzero value is an error, and we may use any number from 1-255 to represent an error. This means we can have many different kinds of errors. `1` is a general error, `126` means that a file cannot be executed, `127` means 'command not found', etc. Here's a list of Bash [Exit Codes With Special Meanings](http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF) showing some of the most common exit codes.

There are also many kinds of success (exit status is `0`). However, a success will allow you to proceed to the next step—you can like print results to a screen, or execute a command, etc.
Although the question is not tagged for C programming and most answers seem to explain the real reason indirectly, I thought I'll answer, what I hope, a C programmer would find useful.

IMHO, the true source of ambiguity is the C standard. For example, in C11 draft spec's (<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>) Section "7.22.4.4 The exit function" vs Section "7.18 Boolean type and values <stdbool.h>", EXIT\_SUCCESS is zero, which is what programs run from the linux shell cmdline are expected to return on success, whereas, bool true is non-zero (#define'ed to 1, but safer to call it non-zero. Why is that? Refer to <https://stackoverflow.com/users/827263/keith-thompson> 's comment in <https://stackoverflow.com/a/40009047/4726668> ).

Quoting from C11 draft spec (<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>):

7.22.4.4 The exit function

"

5 Finally, control is returned to the host environment. If the value of status is zero or EXIT\_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status is EXIT\_FAILURE, an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.

"

vs

7.18 Boolean type and values <stdbool.h>

"

3
The remaining three macros are suitable for use in #if preprocessing directives. They are

true

which expands to the integer constant 1,

false

which expands to the integer constant 0, and

\_ \_bool\_true\_false\_are\_defined

which expands to the integer constant 1.

"