|
Drag[en]gine Script Module DragonScript 1.35
|
Runtime meter. More...
Public Member Functions | |
Constructors | |
| RuntimeMeter | new () |
| Create runtime meter. | |
Management | |
| void | reset (int meter) |
| Reset meter by 0-based index. | |
| void | reset (int meterFirst, int meterCount) |
| Reset range of meters by 0-based index. | |
| float | elapsed (int meter) |
| Elapsed time in seconds for meter. | |
| int | elapsedMicroSec (int meter) |
| Elapsed time in micro-seconds for meter. | |
| void | counterReset (int counter) |
| Reset counter. | |
| void | counterReset (int counterFirst, int counterCount) |
| Reset range of counters. | |
| void | counterAdd (int meter, int counter) |
| Add elapsed time in micro-seconds off meter to a counter. | |
| int | counterTime (int counter) |
| Accumulated time in a counter in micro-seconds. | |
| float | counterTimeSeconds (int counter) |
| Accumulated time in a counter in seconds. | |
| int | counterUpdates (int counter) |
| Number of times a counter has been incremented. | |
| int | counterAverageTime (int counter) |
| Average time per update from a counter in micro-seconds. | |
| float | counterAverageTimeSeconds (int counter) |
| Average time per update from a counter in seconds. | |
Runtime meter.
Support for time consumption testing for debugging purpose.
TO do timing measuring reset the count of counters you would like to keep track off. Then reset the count of meters matching the count of concurrent timers you want to keep track off. At appropriate times call counterAdd() to add the accumulated time in a meter to a counter. The meter is reset at the time counterAdd() is called. Once finished you can retrieve the accumulated time from the counters.
The following code shows an example flow:
This is a native class.
| void Dragengine.RuntimeMeter.counterAdd | ( | int | meter, |
| int | counter ) |
Add elapsed time in micro-seconds off meter to a counter.
Resets the meter to 0 afterwards.
References counterReset().
Referenced by counterTimeSeconds().
| int Dragengine.RuntimeMeter.counterAverageTime | ( | int | counter | ) |
Average time per update from a counter in micro-seconds.
If no updates have been done 0 is returned.
References counterTimeSeconds(), and counterUpdates().
Referenced by counterAverageTimeSeconds().
| float Dragengine.RuntimeMeter.counterAverageTimeSeconds | ( | int | counter | ) |
Average time per update from a counter in seconds.
If no updates have been done 0 is returned.
References counterAverageTime(), and counterAverageTimeSeconds().
Referenced by counterAverageTimeSeconds().
| void Dragengine.RuntimeMeter.counterReset | ( | int | counter | ) |
Reset counter.
If not used yet the counter is created.
Referenced by counterAdd(), and counterReset().
| void Dragengine.RuntimeMeter.counterReset | ( | int | counterFirst, |
| int | counterCount ) |
| int Dragengine.RuntimeMeter.counterTime | ( | int | counter | ) |
Accumulated time in a counter in micro-seconds.
Referenced by counterUpdates().
| float Dragengine.RuntimeMeter.counterTimeSeconds | ( | int | counter | ) |
Accumulated time in a counter in seconds.
References counterAdd().
Referenced by counterAverageTime().
| int Dragengine.RuntimeMeter.counterUpdates | ( | int | counter | ) |
Number of times a counter has been incremented.
References counterTime().
Referenced by counterAverageTime().
| float Dragengine.RuntimeMeter.elapsed | ( | int | meter | ) |
| int Dragengine.RuntimeMeter.elapsedMicroSec | ( | int | meter | ) |
Elapsed time in micro-seconds for meter.
Resets the meter to 0 after returning.
References elapsedMicroSec().
Referenced by elapsedMicroSec().
| RuntimeMeter Dragengine.RuntimeMeter.new | ( | ) |
| void Dragengine.RuntimeMeter.reset | ( | int | meter | ) |
| void Dragengine.RuntimeMeter.reset | ( | int | meterFirst, |
| int | meterCount ) |