Add Timer implementation
pid-file: Use %PRIi64 instead of %lld to write PID to file

This should be more robust.