@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_core.class) public class TickMeter extends Pointer
The class computes passing time by counting the number of ticks per second. That is, the following code computes the execution time in seconds:
TickMeter tm;
tm.start();
// do something ...
tm.stop();
std::cout << tm.getTimeSec();
It is also possible to compute the average time over multiple runs:
TickMeter tm;
for (int i = 0; i < 100; i++)
{
tm.start();
// do something ...
tm.stop();
}
double average_time = tm.getTimeSec() / tm.getCounter();
std::cout << "Average time in second per iteration is: " << average_time << std::endl;
getTickCount, getTickFrequency
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TickMeter()
the default constructor
|
TickMeter(long size)
Native array allocator.
|
TickMeter(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getCounter()
returns internal counter value.
|
double |
getTimeMicro()
returns passed time in microseconds.
|
double |
getTimeMilli()
returns passed time in milliseconds.
|
double |
getTimeSec()
returns passed time in seconds.
|
long |
getTimeTicks()
returns counted ticks.
|
TickMeter |
position(long position) |
void |
reset()
resets internal values.
|
void |
start()
starts counting ticks.
|
void |
stop()
stops counting ticks.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public TickMeter(Pointer p)
Pointer.Pointer(Pointer)
.public TickMeter(long size)
Pointer.position(long)
.public TickMeter()
public void start()
public void stop()
public double getTimeMicro()
public double getTimeMilli()
public double getTimeSec()
public void reset()
Copyright © 2020. All rights reserved.