clock_getTime

  • Thread starter Thread starter andi1706
  • Start date Start date
A

andi1706

Hi all,
is there anything like the clock_getTime function for windows?
I want to run a Linux-project within .Net that uses the clock_getTime
function to get nanoseconds.
Thanks for your help

Andi
 
andi1706 said:
is there anything like the clock_getTime function for windows?
I want to run a Linux-project within .Net that uses the clock_getTime
function to get nanoseconds.

The disclaimer: I know nothing of 'nix, 'nux or pux.

However, if what you are looking for is a finely grained timer you can use

GetSystemAsFileTime();

which returns the time in 100ns units from some 1 Jan 1601.

However, no version of Windows (except perhaps the CE variants) can be
called a real-time so you'll get nowhere near the ns precision that you
want.

Usually when such fine resolution is required, the thing to do is call
QueryPerformanceCounter() and QueryPerformanceFrequency() if the processor
has the required support.

Regards,
Will
 
Back
Top