# OS_CalcThreadStatistics

## C Specification

  `#include <nitro/os.h>`
  `void OS_CalcThreadStatistics( void* statBuf, OSThread* thread );`

## Arguments

statBuf | Function cost statistics buffer
thread | The thread that maintains the function cost calculation buffer that is used for accumulation.

## Return Values

None.

## Description

This function accumulates function cost calculation data in a specified function cost statistics buffer.

You must initialize `statBuf` with `OS_InitStatistics()`. You can also append to previously accumulated results. The function cost calculation buffer that is used to accumulate is declared by the thread that is specified by thread. However, avoid doing this when, for example, another thread is writing to the buffer.

If this function is compiled for debugging, it will function properly. However, if compiled for the final ROM version (FINALROM) library, it will always return 0.

## See Also

`OS_InitStatistics, OS_CalcStatistics
`

## Revision History

05/18/2004 Initial Version

CONFIDENTIAL