## OilProfile OilProfile — Measuring the length of time needed to execute Liboil functions. |

## Synopsis

                        OilProfile;
    #define             OIL_PROFILE_HIST_LENGTH
    unsigned long       oil_profile_stamp                   (void);
    void                oil_profile_init                    (OilProfile *prof);
    void                oil_profile_stop_handle             (OilProfile *prof);
    void                oil_profile_get_ave_std             (OilProfile *prof,
                                                             double *ave_p,
                                                             double *std_p);
    #define             oil_profile_start                   (x)
    #define             oil_profile_stop                    (x)

## Description

## Details

### OilProfile

    typedef struct {
    } OilProfile;

An opaque structure representing profiling information.

### OIL_PROFILE_HIST_LENGTH

    #define OIL_PROFILE_HIST_LENGTH 10

Internal definition of the number of histogram entries in OilProfile.

### oil_profile_stamp ()

    unsigned long       oil_profile_stamp                   (void);

Creates a timestamp based on a CPU-specific high-frequency counter, if available.

Returns : | a timestamp

### oil_profile_init ()

    void                oil_profile_init                    (OilProfile *prof);

Initializes a profiling structure.

`prof` : | the OilProfile structure

### oil_profile_stop_handle ()

    void                oil_profile_stop_handle             (OilProfile *prof);

Handles post-processing of a single profiling run.

FIXME: need more info

`prof` : | the OilProfile structure

### oil_profile_get_ave_std ()

    void                oil_profile_get_ave_std             (OilProfile *prof,
                                                             double *ave_p,
                                                             double *std_p);

Calculates the average and standard deviation of a number of profiling runs, and places the results in the locations provided by `ave_p` and `std_p`. Either `ave_p` and `std_p` may be NULL, in which case the values will not be written.

`prof` : | the OilProfile structure
`ave_p` : | pointer to average
`std_p` : | pointer to standard deviation

### oil_profile_start()

    #define             oil_profile_start(x)

Starts a profiling run by obtaining a timestamp via `oil_profile_stamp()` and writing it into `x`.

`x` : | a pointer to an OilProfile structure

### oil_profile_stop()

    #define             oil_profile_stop(x)

Stops a profiling run by obtaining a timestamp via `oil_profile_stamp()` and writing it into `x`. It then calls `oil_profile_stop_handle()` to handle post-processing of the profiling run.

`x` : | a pointer to an OilProfile structure