profile

Gamma: Version 4.0
Prev |  | Next

# `profile`

`profile` -- collects statistics on function usage and run time.

## Syntax

    profile (on_p, tick_nanosecs?)

## Arguments

`on_p`

  If non-nil, start profiling, else stop profiling.

`tick_nanosecs`

  Reset the QNX 4 tick size to this many nanoseconds before beginning to profile.

## Returns

The previous state of profiling.

## Description

This function starts (or stops) collecting statistics on the usage and run time of all functions in the system. The profile mechanism uses an interrupt on the QNX 4 tick clock, and so must run with root permissions. If the optional `tick_nanosecs` argument is provided, this function will reset the tick size. Otherwise, it will profile using the current tick size. The smaller the tick size, the more precise is the profile result.

## Example

        Gamma> profile(t,500000);
        nil

## See Also

`function_calls`, `function_runtime`

Prev | Home | Next
`gc_trace` | Up | `set_autotrace`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.