typedef LONGLONG REFERENCE_TIME;
I want to convert double Time
to REFERENCE_TIME Time
, how to do it?
typedef LONGLONG REFERENCE_TIME;
I want to convert double Time
to REFERENCE_TIME Time
, how to do it?
Assuming LONGLONG is just a typedef for a built in type, you can try:
REFERENCE_TIME rt = static_cast<REFERENCE_TIME>(Time);
But, it would be safer to use boost::numeric_cast
Reference time is absed on a 100ns clock. That means there are 10,000,000 ticks a second.
So assuming your double is in seconds then you need to do
REFERENCE_TIME rt = static_cast< REFERENCE_TIME >( doubleTime * 10000000.0 );