Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**model****Member**- Registered: 2011-08-10
- Posts: 142

Hi ,

I get the time of each line of code of my program .

Program :

cout<<" timeBeginPeriod : " << timeBeginPeriod(1) <<endl; //Add Winmm.lib in Project

cout<<" start Time : " << ( (double)GetTickCount() )/1000<<endl;

cout<<" Hi "<< ( (double)GetTickCount() )/1000<<endl;

cout<<" Hi , 123 456 "<< ( (double)GetTickCount() )/1000<<endl;

Note : GetTickCount() give me number of milisecs . ./

And i get this

timeBeginPeriod : 0

start Time : 137809

Hi 137809

endTimer : 0

Which mean , each line of code taking time " 137809 " in secs .

My question is What does mean by 137809 . Does it mean its taking that its taking 17 secs and 809 milisec ?

Maths is Doctor that make our life easy ..

https://www.facebook.com/groups/Maths.GIS/

Offline

**model****Member**- Registered: 2011-08-10
- Posts: 142

model wrote:

Hi ,

I get the time of each line of code of my program .

Program :

cout<<" timeBeginPeriod : " << timeBeginPeriod(1) <<endl; //Add Winmm.lib in Project

cout<<" start Time : " << ( (double)GetTickCount() )/1000<<endl;

cout<<" Hi "<< ( (double)GetTickCount() )/1000<<endl;

cout<<" Hi , 123 456 "<< ( (double)GetTickCount() )/1000<<endl;Note : GetTickCount() give me number of milisecs . ./

And i get this

timeBeginPeriod : 0

start Time : 137809

Hi 137809

endTimer : 0Which mean , each line of code taking time " 137809 " in secs .

My question is What does mean by 137809 . Does it mean its taking that its taking 17 secs and 809 milisec ?

I think its means 20sec and 809 milisec . Right ?

if so that mean in c++ each line of code take 20 secs and 809 mili secs . hmmmm ............

Maths is Doctor that make our life easy ..

https://www.facebook.com/groups/Maths.GIS/

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 92,892

Hi model;

That is not your exact output, what happened to the 123456?

Also 137809 is 137 seconds and 809 milliseconds.

Something is not right but GetTickCount() is incremental so if two of them are the same that means 0 time occurred between two lines.

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline

**model****Member**- Registered: 2011-08-10
- Posts: 142

bobbym wrote:

Hi model;

That is not your exact output, what happened to the 123456?

Also 137809 is 137 seconds and 809 milliseconds.

Something is not right but GetTickCount() is incremental so if two of them are the same that means 0 time occurred between two lines.

ahh hy 123456 is inside cout just for showing some output .that is not time .

Maths is Doctor that make our life easy ..

https://www.facebook.com/groups/Maths.GIS/

Offline

**model****Member**- Registered: 2011-08-10
- Posts: 142

Actually , i have moving objects presented in video . i calculated distance . I need to find speed . I am thinking that where should i add statement to get time and use it for speed calculation,. for deciding that i need to understand time meaning w,r,t code.

Well could you please tell me that how are u say : 137809 is 137 seconds and 809 milliseconds. ?

Maths is Doctor that make our life easy ..

https://www.facebook.com/groups/Maths.GIS/

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 92,892

The GetTickCount() function if I remember counts in milliseconds from the start of the machine.

So there are 137809 milliseconds, when you divide by 1000 ( there are 1000 milliseconds in a second ) you will get 137 seconds and 809 milliseconds.

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline