11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The following diagram illustrates how low-resolution measurement works. We can see that the section of code actuallybegins at 0.5 ms and ends at 5.2 ms, which means that its actual execution time is (5.2 - 0.5) = 4.7 ms. However witha tick of 1 ms, the first call to OS_GetTime() returns 0, and the second call returns 5. The measured execution timeof the code would therefore result in (5 - 0) = 5 ms.OS_GetTime() => 0 OS_GetTime() => 5Code to be timedOS_Time0.5 ms 5.2 ms0 ms 1 ms 2 ms 3 ms 4 ms 5 ms6 msFor many applications, low-resolution measurement may be fully sufficient for your needs. In some cases, it may bemore desirable than high-resolution measurement due to its ease of use and faster computation time.Low-resolution measurement API function overviewRoutineOS_GetTime()OS_GetTime32()OS_GetTime()DescriptionReturns the current system time in ticks.Prototypeint OS_GetTime (void);Return valueThe system variable OS_Time as a 16- or 32-bit integer value.Additional InformationThis function returns the system time as a 16-bit value on 8/16-bit CPUs, and as a 32-bit value on 32-bit CPUs. TheOS_Time variable is a 32-bit value. Therefore, if the return value is 32-bit, it is simply the entire contents of theOS_Time variable. If the return value is 16-bit, it is the lower 16 bits of the OS_Time variable.OS_GetTime32()DescriptionDescriptionTable 118: Low-resolution measurement API overviewReturns the current system time in ticks.Returns the current system time in ticks as a 32-bit value.Returns the current system time in ticks as a 32-bit value.114<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!