Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tickcount and milliseconds in C++

Tags:

c++

winapi

How do I convert from TickCounts to Milliseconds?

this is what I used:

long int before = GetTickCount();
long int after = GetTickCount();

I want the difference of it in seconds.

like image 786
SuperString Avatar asked Nov 28 '22 20:11

SuperString


2 Answers

int seconds = (after - before) /1000;
like image 115
Priyank Bolia Avatar answered Dec 05 '22 19:12

Priyank Bolia


for more precision, there is also QueryPerformanceCounter()

like image 35
jlru Avatar answered Dec 05 '22 19:12

jlru