| Customize Help
| Save Settings

MappTimer



Function Map
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
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the current application context.

Click to summarize 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
Click to summarizeValue Description
Click to summarize 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)
Click to summarize M_TIMER_RESET +

Resets the MIL timer to zero.

Click to summarize M_TIMER_RESOLUTION +

Reads the MIL timer resolution, in seconds.

Click to summarize M_TIMER_WAIT +

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

Combination value 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
Click to summarizeCombination value Description
Click to summarize M_SYNCHRONOUS

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

Combination values 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
Click to summarizeCombination value Description
Click to summarize 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)
Click to summarize 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 TIMER READ TIMER RESOLUTION TIMER READ TIMER RESOLUTION