Drag[en]gine Script Module DragonScript
1.23
|
Runtime meter. More...
Public Member Functions | |
Constructors | |
RuntimeMeter | new () |
Create runtime meter. More... | |
Management | |
void | reset (int meter) |
Reset meter by 0-based index. More... | |
void | reset (int meterFirst, int meterCount) |
Reset range of meters by 0-based index. More... | |
float | elapsed (int meter) |
Elapsed time in seconds for meter. More... | |
int | elapsedMicroSec (int meter) |
Elapsed time in micro-seconds for meter. More... | |
void | counterReset (int counter) |
Reset counter. More... | |
void | counterReset (int counterFirst, int counterCount) |
Reset range of counters. More... | |
void | counterAdd (int meter, int counter) |
Add elapsed time in micro-seconds off meter to a counter. More... | |
int | counterTime (int counter) |
Accumulated time in a counter in micro-seconds. More... | |
float | counterTimeSeconds (int counter) |
Accumulated time in a counter in seconds. More... | |
int | counterUpdates (int counter) |
Number of times a counter has been incremented. More... | |
int | counterAverageTime (int counter) |
Average time per update from a counter in micro-seconds. More... | |
float | counterAverageTimeSeconds (int counter) |
Average time per update from a counter in seconds. More... | |
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.
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.
float Dragengine.RuntimeMeter.counterAverageTimeSeconds | ( | int | counter | ) |
Average time per update from a counter in seconds.
If no updates have been done 0 is returned.
void Dragengine.RuntimeMeter.counterReset | ( | int | counter | ) |
Reset counter.
If not used yet the counter is created.
void Dragengine.RuntimeMeter.counterReset | ( | int | counterFirst, |
int | counterCount | ||
) |
Reset range of counters.
If not used yet the counters are created.
int Dragengine.RuntimeMeter.counterTime | ( | int | counter | ) |
Accumulated time in a counter in micro-seconds.
float Dragengine.RuntimeMeter.counterTimeSeconds | ( | int | counter | ) |
Accumulated time in a counter in seconds.
int Dragengine.RuntimeMeter.counterUpdates | ( | int | counter | ) |
Number of times a counter has been incremented.
float Dragengine.RuntimeMeter.elapsed | ( | int | meter | ) |
Elapsed time in seconds for meter.
Resets the meter to 0 after returning.
int Dragengine.RuntimeMeter.elapsedMicroSec | ( | int | meter | ) |
Elapsed time in micro-seconds for meter.
Resets the meter to 0 after returning.
RuntimeMeter Dragengine.RuntimeMeter.new | ( | ) |
Create runtime meter.
void Dragengine.RuntimeMeter.reset | ( | int | meter | ) |
Reset meter by 0-based index.
If not used yet the meter is created.
void Dragengine.RuntimeMeter.reset | ( | int | meterFirst, |
int | meterCount | ||
) |
Reset range of meters by 0-based index.
If not used yet the meters are created.