Synchronized value between C # and C ++?
Is there a function that exists in both C # and (unmanaged) C ++ that returns a synchronized number (like a float or int)?
For example, is there something that brings the exact system time, at least for the second, that will return the same result in both C ++ and C # being called at the same time?
Just wondering = =
a source to share
Are you talking about managed C ++ (C ++ / CLI) or native C ++ here? If you are using managed code all over the place, then the obvious solution is to use a property Environment.TickCount
. In native C ++, the equivalent is a Win32 API function GetTickCount
.
a source to share
A better choice for complete control over your control might be to use p / invoke to call a Win32 function, such as GetSystemTime or GetTickCount, directly from C #.
But underneath that all DateTime is just calling Win32 functions, so there is no reason it would give you significantly different realtime time than you would use regular C-style Win32 calls.
a source to share