| MIL 10 Reference
| Customize Help
| Save Settings

MappTimer



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Control or inquire a MIL timer's setting or value.
Syntax
MIL_DOUBLE MappTimer(
MIL_ID ContextAppId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE *TimePtr //in-out
)
Description

This function controls or inquires a MIL timer's setting or value. There is a different MIL timer for each thread of the application, and one global MIL timer for the application. There is also a separate non-resettable trace MIL timer used by Matrox Profiler and other MIL trace functionality. By default, the MIL timer that is accessed is the timer of the current thread.

This function is useful for benchmarking operations in a MIL application. The timer resolution varies according to the hardware and operating system used.

Note that MIL functions run at a slower speed during debug mode. Therefore, once you are done debugging your application, you should compile in release mode to achieve maximum processing speed.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextAppId

Specifies the identifier of the application context to use.

function map For specifying the application context
CollapseValue Description
Collapse M_DEFAULT

Specifies the current application context.

Collapse Application Context Identifier

Specifies the application context identifier.

ControlType

Specifies the control to exert on the MIL timer. It can be set to one of the following:

function map For MIL timers
CollapseValue Description
Collapse M_TIMER_READ +

Reads the time, in sec, of the MIL timer since the last reset. Note that the time read takes into account (subtracts) the μsec (microseconds) needed to execute M_TIMER_READ.

(summarize)
Collapse M_TIMER_RESET +

Resets the MIL timer to zero.

Collapse M_TIMER_RESOLUTION +

Reads the MIL timer resolution, in seconds.

Collapse M_TIMER_WAIT +

Waits for the specified period of time, in sec, before returning.

Combination constant for the values listed in For MIL timers.

You can add the following value to the above-mentioned values to set whether the function will be called synchronously.

function map For all ControlType parameters
CollapseCombination value Description
Collapse M_SYNCHRONOUS

Forces the function to wait for all pending calls of the current thread to complete before continuing.

Combination constants for the values listed in For MIL timers.

You can add one of the following values to the above-mentioned values to specify to access the global MIL timer or the trace MIL timer, instead of the timer of the current thread.

function map For controlling and accessing the global MIL timer or trace MIL timer
CollapseCombination value Description
Collapse M_GLOBAL

Executes the requested timer operation using the global MIL timer. Note that, in a MIL application, there is only one global MIL timer that is accessible by all MIL threads.

If used with M_SYNCHRONOUS, the global MIL timer will wait for all pending calls of the current thread to complete before continuing.

(summarize)
Collapse M_TRACE

Executes the requested timer operation using the trace MIL timer. This timer is accessible by all MIL threads in the current MIL application.

Note that this value can only be combined with M_TIMER_READ or M_TIMER_RESOLUTION.

(summarize)
TimePtr

Specifies the address of the variable in which to store the timer information produced by M_TIMER_READ or M_TIMER_RESOLUTION. Since MappTimer() also returns the requested information when M_TIMER_READ or M_TIMER_RESOLUTION are selected, you can set this parameter to M_NULL.

For M_TIMER_RESET, set TimePtr to M_NULL.

For M_TIMER_WAIT, TimePtr specifies the address of the variable from which to read the timer information.

Return value
The returned value, for M_TIMER_READ and M_TIMER_RESOLUTION, is the requested information cast to a MIL_DOUBLE. For M_TIMER_RESET and M_TIMER_WAIT, this function returns 0.0.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT TIMER READ TIMER RESET TIMER RESOLUTION TIMER WAIT SYNCHRONOUS GLOBAL TRACE