manipulating LARGE_INTEGERS

Here it is:

LARGE_INTEGER x,y;
///
//Some codes...
///

__int64 diff = x.QuadPart - y.QuadPart

Because QuadPart is defined as a LONGLONG , that same as __int64.


LARGE_INTEGER is a union of a 64-bit integer and a pair of 32-bit integers. If you want to perform 64-bit arithmetic on one you need to select the 64-bit int from inside the union.

LARGE_INTEGER a = { 0 };
LARGE_INTEGER b = { 0 };

__int64 c = a.QuadPart - b.QuadPart;

LARGE_INTEGER is a union, you can still use .QuadPart if you want to work on the 64-bit value.


LARGE_INTEGER is a union, documented here. You probably want a QuadPart member.

Tags:

C++

Int64