Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on October 28, 2003, 11:53:07 pm

Title: OT program question
Post by: Bobboau on October 28, 2003, 11:53:07 pm
I was just playing around with something for some reason and I needed to get the current time in milliseconds so I could get a floating point frame time, time.h/time() gives me seconds, were is the function for milliseconds, I have tryed google and it hasn't provided anything usful and I need to get to sleep.

that should have been OT, I do so need sleep
Title: OT program question
Post by: StratComm on October 29, 2003, 12:00:29 am
To be honest Bob, my memory of STL is a little hazy.  However, if memory serves, the time class may not be helpful, as all it measures time in seconds.  As for more general programming help, I'm afraid I'm not of much use.
Title: OT program question
Post by: Goober5000 on October 29, 2003, 12:03:48 am
Thread title edited. ;)
Title: OT program question
Post by: Eternal One on October 29, 2003, 02:13:12 am
If it only needs to work in Windows, I believe the easiest way is to use timeGetTime(), look it up from MSDN (http://msdn.microsoft.com/library/default.asp)
Title: OT program question
Post by: Kazan on October 29, 2003, 02:15:37 am
clock() - milliseconds since beginning of this thread

only really usefull for time differences that need high accuracy
Title: OT program question
Post by: Eternal One on October 29, 2003, 02:52:47 am
Kazan, clock() returns the tick count. You'd have to multiply with 1000/CLK_TCK to get milliseconds.
Title: OT program question
Post by: Bobboau on October 30, 2003, 11:13:40 pm
are there stl grapics ruteens
Title: OT program question
Post by: Fry_Day on October 31, 2003, 05:37:19 am
GetTickCount() is a standard windows API function that returns the number of milliseconds since the computer has been turned on