STS_delta
2-418
C Interface
Syntax
STS_delta(sts,value);
Parameters
STS_Handle sts;
/* statistics object handle */
LgInt
value;
/* new value to update statistics object */
Return Value
Void
Reentrant
no
Description
Each STS object contains a previous value that can be initialized with
Tconf or with a call to STS_set. A call to STS_delta subtracts the previous
value from the value it is passed and then invokes STS_add with the
result to update the statistics. STS_delta also updates the previous value
with the value it is passed.
STS_delta can be used in conjunction with STS_set to monitor the
difference between a variable and a desired value or to benchmark
program performance. You can benchmark code by using paired calls to
STS_set and STS_delta that pass the value provided by CLK_gethtime.
STS_set(&sts, CLK_gethtime
()
);
"processing to be benchmarked"
STS_delta(&sts, CLK_gethtime
()
);
Constraints and
Calling Context
❏
Before the first call to STS_delta is made, the previous value of the
STS object should be initialized either with a call to STS_set or by
setting the prev property of the STS object using Tconf.
Example
STS_set(&sts, targetValue);
"processing"
STS_delta(&sts, currentValue);
"processing"
STS_delta(&sts, currentValue);
See Also
STS_add
STS_reset
STS_set
CLK_gethtime
CLK_getltime
PRD_getticks
TRC_disable
TRC_enable
STS_delta
Update statistics using difference between provided value & setpoint