STS_set
2-420
C Interface
Syntax
STS_set(sts, value);
Parameters
STS_Handle sts;
/* statistics object handle */
LgInt
value;
/* new value to update statistics object */
Return Value
Void
Reentrant
no
Description
STS_set can be used in conjunction with STS_delta to monitor the
difference between a variable and a desired value or to benchmark
program performance. STS_set saves a value as the previous value in
an STS object. STS_delta subtracts this saved value from the value it is
passed and invokes STS_add with the result.
STS_delta also updates the previous value with the value it was passed.
Depending on what you are measuring, you can need to use STS_set to
reset the previous value before the next call to STS_delta.
You can also set a previous value for an STS object in the configuration.
STS_set changes this value.
See STS_delta for details on how to use the value you set with STS_set.
Example
This example gathers performance information for the processing
between STS_set and STS_delta.
STS_set(&sts, CLK_getltime
()
);
"processing to be benchmarked"
STS_delta(&sts, CLK_getltime
()
);
This example gathers information about a value’s deviation from the
desired value.
STS_set(&sts, targetValue);
"processing"
STS_delta(&sts, currentValue);
"processing"
STS_delta(&sts, currentValue);
"processing"
STS_delta(&sts, currentValue);
This example gathers information about a value’s difference from a base
value.
STS_set
Save a value for STS_delta