![]() |
|
#1
|
|||
|
|||
C++ and timeHi
please i want help from you, my question is: How I can pause an execution of program for a few minutes depends on user inter key ,in my program i use time to calculate position of person who is falling from the plane ,I use openGl with C++? I am trying sleep() , System("PAUSE") , and i hadn't useful from any ones. |
|||
|
#2
|
|||
|
|||
Re: C++ and timeThis works for me. Hope it helps.
CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: C++ and timeQuote:
thank you for replay .. my problem not with pause execution exactly i take time from computer with GetTickCount() to calculate the position then when i want to pause execution , the time didn't pause and when i resume execution the time take wrong value ,then sleep () doesn't work . |
|
#4
|
||||
|
||||
Re: C++ and timeUse a variable to keep track of the total time that the system is paused. Then subtract that time from the time returned by getTickCount(). Example:
CPP / C++ / C Code:
The getTime() function will give you the time minus the time spent paused. On a side note (since you're using OpenGL), if you're using GLUT, you can use glutGet(GLUT_ELAPSED_TIME); to get the elapsed time since the last call to glutInit(). Then you don't need to include windows.h, which is good if you're aiming for platform independence. __________________
www.blake-foster.com |
|
#5
|
|||
|
|||
Re: C++ and timeman your sharp Blake.. care to tell us or just me about some of the programming projects that are NOT listed on your website??
Dan |
|
#6
|
||||
|
||||
Re: C++ and timeThanks! I don't have this on my website yet.
__________________
www.blake-foster.com |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BryanSoft.Com Free Cpanel Hosting And Resellers One Time Posting!!! | rewer | Free Web Hosting | 0 | 22-Oct-2008 20:56 |
| Asynchronous transfer question | crystalattice | Miscellaneous Programming Forum | 2 | 24-Jan-2007 21:39 |
| constructors/classes | mapes479 | C++ Forum | 3 | 19-Nov-2006 18:34 |
| Fortran problem... | Justin Fox | Miscellaneous Programming Forum | 6 | 24-Oct-2006 16:30 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The