mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Added a startup timer
This commit is contained in:
parent
81c4186179
commit
407da2aea8
2 changed files with 13 additions and 2 deletions
|
@ -196,6 +196,9 @@ float FPS = 120.f;
|
|||
timeval timerStart, timerEnd;
|
||||
timeval lastTimeIdle;
|
||||
double elapsedTime;
|
||||
timeval applicationStartupTime;
|
||||
bool justStarted = true;
|
||||
|
||||
|
||||
#ifdef MARKER_CAPTURE
|
||||
|
||||
|
@ -783,7 +786,7 @@ void display(void)
|
|||
float sphereRadius = 0.25f;
|
||||
glColor3f(1,0,0);
|
||||
glPushMatrix();
|
||||
glTranslatef( 0.0f, sphereRadius, 0.0f );
|
||||
//glTranslatef( 0.0f, sphereRadius, 0.0f );
|
||||
glutSolidSphere( sphereRadius, 15, 15 );
|
||||
glPopMatrix();
|
||||
|
||||
|
@ -915,6 +918,13 @@ void display(void)
|
|||
|
||||
glutSwapBuffers();
|
||||
frameCount++;
|
||||
|
||||
// If application has just started, report time from startup to now (first frame display)
|
||||
if (justStarted) {
|
||||
printf("Startup Time: %4.2f\n",
|
||||
(usecTimestampNow() - usecTimestamp(&applicationStartupTime))/1000000.0);
|
||||
justStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
int setValue(int state, int *value) {
|
||||
|
@ -1349,6 +1359,7 @@ void audioMixerUpdate(in_addr_t newMixerAddress, in_port_t newMixerPort) {
|
|||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
gettimeofday(&applicationStartupTime, NULL);
|
||||
const char* domainIP = getCmdOption(argc, argv, "--domain");
|
||||
if (domainIP) {
|
||||
strcpy(DOMAIN_IP,domainIP);
|
||||
|
|
|
@ -327,7 +327,7 @@ void *checkInWithDomainServer(void *args) {
|
|||
sockaddr_in tempAddress;
|
||||
memcpy(&tempAddress.sin_addr, pHostInfo->h_addr_list[0], pHostInfo->h_length);
|
||||
strcpy(DOMAIN_IP, inet_ntoa(tempAddress.sin_addr));
|
||||
printf("Domain server %s: \n", DOMAIN_HOSTNAME);
|
||||
printf("Domain server: %s \n", DOMAIN_HOSTNAME);
|
||||
|
||||
} else {
|
||||
printf("Failed lookup domainserver\n");
|
||||
|
|
Loading…
Reference in a new issue