]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/TimerLib.h
2 Provides calibrated delay and performance counter services.
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Stalls the CPU for at least the given number of microseconds.
15 Stalls the CPU for the number of microseconds specified by MicroSeconds.
17 @param MicroSeconds The minimum number of microseconds to delay.
19 @return The value of MicroSeconds inputted.
29 Stalls the CPU for at least the given number of nanoseconds.
31 Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
33 @param NanoSeconds The minimum number of nanoseconds to delay.
35 @return The value of NanoSeconds inputted.
45 Retrieves the current value of a 64-bit free running performance counter.
47 The counter can either count up by 1 or count down by 1. If the physical
48 performance counter counts by a larger increment, then the counter values
49 must be translated. The properties of the counter can be retrieved from
50 GetPerformanceCounterProperties().
52 @return The current value of the free running performance counter.
57 GetPerformanceCounter (
62 Retrieves the 64-bit frequency in Hz and the range of performance counter
65 If StartValue is not NULL, then the value that the performance counter starts
66 with immediately after is it rolls over is returned in StartValue. If
67 EndValue is not NULL, then the value that the performance counter end with
68 immediately before it rolls over is returned in EndValue. The 64-bit
69 frequency of the performance counter in Hz is always returned. If StartValue
70 is less than EndValue, then the performance counter counts up. If StartValue
71 is greater than EndValue, then the performance counter counts down. For
72 example, a 64-bit free running counter that counts up would have a StartValue
73 of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
74 that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
76 @param StartValue The value the performance counter starts with when it
78 @param EndValue The value that the performance counter ends with before
81 @return The frequency in Hz.
86 GetPerformanceCounterProperties (
87 OUT UINT64
*StartValue
, OPTIONAL
88 OUT UINT64
*EndValue OPTIONAL
92 Converts elapsed ticks of performance counter to time in nanoseconds.
94 This function converts the elapsed ticks of running performance counter to
95 time value in unit of nanoseconds.
97 @param Ticks The number of elapsed ticks of running performance counter.
99 @return The elapsed time in nanoseconds.
104 GetTimeInNanoSecond (