« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.7.1 - GetHostTick

Queries the host system's steady (monotonic) clock, preferentially with high precision.

Syntax

LJM_LONG_LONG_RETURN LJM_GetHostTick()

Returns

The current clock tick in microseconds, as a 64-bit integer. Resolution may vary.

On Windows, sleep states (such as standby, hibernate, or connected standby) do not affect LJM_GetHostTick. Other platforms should be manually tested.

Examples

[C/C++] Measure how long an operation takes.

double value;
long long time0 = LJM_GetHostTick();
err = LJM_eReadName(handle, "SERIAL_NUMBER", &value);
long long time1 = LJM_GetHostTick();
ErrorCheck(err, "LJM_eReadName");
printf("LJM_eReadName took %lld microseconds.\n", time1 - time0);

Device I/O times can vary greatly, but this prints something like:

LJM_eReadName took 338 microseconds.