Hi Gurus All!
I am not finding any function for testing the speed of my driver code i
have written.
I cannot use KeQueryTickCount( ) for this because it has a resolution in
milliseconds. so it shows no change.
I tried using KeQuerySystemTime( ) for it coz, it gives 100 ns
resolution as described. But the problem is it is also showing no change.
Although i know that the code has PCI acceses. so can anybody help me solve
this problem.
Tks in adv.
sajidsiraj
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hello,
maybe this helps
//---------------------------------------------------------------------------
// Project : Some VDW based projects
// FileName : $RCSfile:$
// Created : 06/05/98
// Version : $Revision:$
// Last access : $Date:$
// Archive : $Source:$
// Copyright : (c) EllSoft Hamburg 1998-2000
// Author : Mathias Ellinger
// Environment : Windows NT kernel mode
// Compiler : Microsoft C++ 10.0
// Contents : Kernel debug interface
// Note : Use Driver::Works from Vireo
// History :
// $Log:$
//---------------------------------------------------------------------------
#if ! defined (__CKTIME_H)
#define __CKTIME_H
#ifndef VDW_VERSION
#include <vdw.h>
#endif
#if !defined(KS)
//
// Performs a x*y/z operation on 64 bit quantities by splitting the operation. The equation
// is simplified with respect to adding in the remainder for the upper 32 bits.
//
// (xh * 10000000 / Frequency) * 2^32 + ((((xh * 10000000) % Frequency) * 2^32 + (xl * 10000000)) / Frequency)
//
#define NANOSECONDS 10000000
#define KSCONVERT_PERFORMANCE_TIME(Frequency, PerformanceTime) ((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS / (Frequency)) << 32) + ((((((ULONGLONG)(ULONG)(PerformanceTime).HighPart * NANOSECONDS) % (Frequency)) << 32) + ((ULONGLONG)(PerformanceTime).LowPart * NANOSECONDS)) / (Frequency)))
#endif
class CTimeDelta
{
public:
CTimeDelta()
{
timeIncrement = KeQueryTimeIncrement(); // 100 ns units
};
void start (void);
void stop (void);
ULONG get (void);
ULONG stopAndGet(void);
protected:
// ULONGLONG startTime;
// ULONGLONG endTime;
LARGE_INTEGER startTime;
LARGE_INTEGER endTime;
ULONGLONG timeIncrement;
LARGE_INTEGER rate;
};
typedef CTimeDelta * PTimeDelta;
inline void
CTimeDelta::start(void)
{
startTime = KeQueryPerformanceCounter(&rate);
// KeQueryTickCount((PLARGE_INTEGER) &startTime);
}
inline void
CTimeDelta::stop(void)
{
endTime = KeQueryPerformanceCounter(&rate);
//KeQueryTickCount((PLARGE_INTEGER) &endTime);
}
inline ULONG
CTimeDelta::get(void)
{
LARGE_INTEGER delta;
delta.QuadPart = endTime.QuadPart - startTime.QuadPart;
delta.QuadPart = KSCONVERT_PERFORMANCE_TIME(rate.QuadPart, delta);
//delta *= timeIncrement; // time in 100 ns unit
delta.QuadPart /= 10000;
return (ULONG) delta.LowPart;
}
inline ULONG
CTimeDelta::stopAndGet(void)
{
stop();
return get();
}
elli
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</vdw.h>
> From: “Sajid Siraj”
>
> I am not finding any function for testing the speed of my driver code i
> have written.
> I cannot use KeQueryTickCount( ) for this because it has a resolution in
> milliseconds. so it shows no change.
> I tried using KeQuerySystemTime( ) for it coz, it gives 100 ns
> resolution as described. But the problem is it is also showing no change.
The resolution of KeQuerySystemTime() is not defined, but the
description implies that it is about 10 ms. The result is given
in units of 100 ns, but that’s not related to the resolution.
> Although i know that the code has PCI acceses. so can anybody help me solve
> this problem.
While you were looking up these various functions beginning with
“KeQuery”, how did you miss KeQueryPerformanceCounter()?
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
System time is updated on every system timer interrupt, which is 10ms default
on uniprocessors and 15 ms on a multicpu. There are some system calls that
let you set this down to 1 ms for the system.
If you are trying to measure time differences, use KeQueryPerformanceCounter().
-DH
----- Original Message -----
From: “J. J. Farrell”
To: “NT Developers Interest List”
Sent: Wednesday, March 28, 2001 5:17 PM
Subject: [ntdev] Re: How to Query Time Elapsed
> > From: “Sajid Siraj”
> >
> > I am not finding any function for testing the speed of my driver code i
> > have written.
> > I cannot use KeQueryTickCount( ) for this because it has a resolution in
> > milliseconds. so it shows no change.
> > I tried using KeQuerySystemTime( ) for it coz, it gives 100 ns
> > resolution as described. But the problem is it is also showing no change.
>
> The resolution of KeQuerySystemTime() is not defined, but the
> description implies that it is about 10 ms. The result is given
> in units of 100 ns, but that’s not related to the resolution.
>
> > Although i know that the code has PCI acceses. so can anybody help me solve
> > this problem.
>
> While you were looking up these various functions beginning with
> “KeQuery”, how did you miss KeQueryPerformanceCounter()?
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com