Advertisement

Parametric Equations

Started by March 15, 2004 01:58 PM
2 comments, last by Kheteris 20 years, 11 months ago
Hi, I was wondering, how I could use time in my OpenGL projects? All, I really need to know is how to get the value of the computer time (clock in bottom right ). Or is there just a simple way to get a variable that moves up/down in value every x seconds/minutes/etc? I was planning on using it for a parametric equation, but maybe some of you know a better way...
if you''re using c++ and MSwindoze look at

GetTickCount

here is a tutorial that speaks bad of GetTickCount and gives an alternative.

http://www.codeproject.com/csharp/highperformancetimercshar.asp
[size="2"]I like the Walrus best.
Advertisement
DWORD CurrentTime;
CurrentTime = GetTickCount();
From winmm.lib:
DWORD timeGetTime();
(use timeBeginPeriod(1) and timeEndPeriod(1) at the start/end of your program to get better accuracy on most computers)

Or:
BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpPerformanceCount);
Using these two gets you far more precise measurements, but it uses 64-bit integers.


int Agony() { return *((int*)0); } Mwahaha... >8)
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke

This topic is closed to new replies.

Advertisement