16 QueryPerformanceFrequency( (LARGE_INTEGER*)&counterRate);
17 QueryPerformanceCounter( (LARGE_INTEGER*)&baseCounter);
19 __int64 counterRate; // LARGE_INTEGER type has no math functions so use int64
22 static AppTime g_appTime;
26 void CopyCStringToPascal( const char* src, unsigned char dst[256])
28 int len = strlen( src);
30 memcpy( dst + 1, src, len);
34 void CopyPascalStringToC( const unsigned char* src, char* dst)
37 memcpy( dst, src + 1, len);
45 QueryPerformanceCounter( (LARGE_INTEGER*)&counter);
47 counter -= g_appTime.baseCounter;
50 time.lo = (unsigned long)counter;
51 time.hi = (unsigned long)(counter >> 32);
56 Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b)
61 __int64 value2 = b.hi;
67 return durationImmediate;
69 __int64 frac = value % g_appTime.counterRate;
70 value /= g_appTime.counterRate;
77 frac /= g_appTime.counterRate;
78 time = (Duration)frac;
83 frac /= g_appTime.counterRate;
86 time = (Duration)value;
93 static char g_filename[ 256];
94 char* ConvertFileName( const char* orgfilename)
96 // translate filename into proper path name
97 if (orgfilename[ 0] == ':')
99 strcpy( g_filename, orgfilename);
101 for (int n = 0; g_filename[ n]; n++)
103 if (g_filename[ n] == ':')
104 g_filename[ n] = '/';