function time
-
I need a function to get time(seconds and microseconds) in windows, like gettimeofday in Linux. Can you help me? Thanks
-
afpr wrote:
I need to get the microseconds too. What is the function, if exists?
Windows does not have that level of resolution. What exactly are you trying to do?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
afpr wrote:
I need to get the microseconds too. What is the function, if exists?
Windows does not have that level of resolution. What exactly are you trying to do?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
You might want to look at this http://www.codeproject.com/datetime/perftimer.asp[^] and this http://www.codeproject.com/datetime/ccputicker.asp[^]
John
-
Check
::GetSystemTimeAsFileTime()
in the MSDN library. -
I need a function to get time(seconds and microseconds) in windows, like gettimeofday in Linux. Can you help me? Thanks
afpr wrote:
I need a function to get time(seconds and microseconds) in windows, like gettimeofday in Linux.
try Multimedia timers .. timeGetDevCaps api will starting api for same
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
afpr wrote:
I need a function to get time(seconds and microseconds) in windows, like gettimeofday in Linux.
try Multimedia timers .. timeGetDevCaps api will starting api for same
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
I have found a solution. Use this functions: /* Initialize everything to 0 */ void sec_init(void) { LARGE_INTEGER lFreq, lCnt; QueryPerformanceFrequency(&lFreq); freq = (double)lFreq.LowPart; QueryPerformanceCounter(&lCnt); start = lCnt.LowPart; } /* return number of seconds since sec_init was called with ** a gross amount of detail */ double sec(void) { LARGE_INTEGER lCnt; long tcnt; QueryPerformanceCounter(&lCnt); tcnt = lCnt.LowPart - start; return ((double)tcnt) / freq; }