Re: Timer with Micro seconds
- From: Chandra <forqueries@xxxxxxxxx>
- Date: Tue, 20 Nov 2007 02:25:08 -0800 (PST)
On Nov 20, 2:26 pm, "Andrew at Plextek (www.plextek.co.uk)"
<a...@xxxxxxxxxxx> wrote:
I've successfully used the performance counter at application level.
Andrew.
Hi Andrew,
Thanks for quick reply. I am able to configure the Performance
Counter, but my application is hanging when i try to use it. The code
which i am using is as below.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LARGE_INTEGER liDelay;
// Query number of ticks per second
if (QueryPerformanceFrequency(&liDelay))
{
// 1ms delay
liDelay.QuadPart /= 1000;
LARGE_INTEGER liTimeOut;
// Get current ticks
if (QueryPerformanceCounter(&liTimeOut))
{
// Create timeout value
liTimeOut.QuadPart += liDelay.QuadPart;
LARGE_INTEGER liCurrent;
do
{
// Get current ticks
QueryPerformanceCounter(&liCurrent);
// Delay until timeout
} while (liCurrent.QuadPart<liTimeOut.QuadPart);
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
liDelay.QuadPart /= 1000; // for milli seconds divide by 1000
liDelay.QuadPart /= 1000; // for second divide by 1
The statement i am varying according to my requirement. But only thig
is when i am trying to get microseconds delay with this code, my
application is getting hanged and it is terminating itself. Any
suggestion from you will be a great help to me. Hope you understand my
problem.
With warm regards,
Chandra.
.
- Follow-Ups:
- Re: Timer with Micro seconds
- From: Andrew at Plextek (www.plextek.co.uk)
- Re: Timer with Micro seconds
- From: Valter Minute
- Re: Timer with Micro seconds
- References:
- Timer with Micro seconds
- From: Chandra
- Re: Timer with Micro seconds
- From: Andrew at Plextek (www.plextek.co.uk)
- Timer with Micro seconds
- Prev by Date: Re: KITL over USB
- Next by Date: mq1132 driver
- Previous by thread: Re: Timer with Micro seconds
- Next by thread: Re: Timer with Micro seconds
- Index(es):
Relevant Pages
|
|