コード例 #1
0
ファイル: timers.c プロジェクト: fourks/bb.js
/*following functions are architecture dependent */
void tl_update_time(void)
{
#ifdef POOL_SOUND
    update_sound();
#endif
#ifdef HAVE_UCLOCK
    currenttime=uclock();
#else
#ifdef USE_CLOCK 
    currenttime=clock();
#else
#ifdef HAVE_GETTIMEOFDAY
    do {
	gettimeofday(&currenttime, &tzp);
    } while (currenttime.tv_usec > 999999);
#else
#ifdef HAVE_FTIME
    ftime(&currenttime);
#endif
#endif
#endif
#endif
#ifdef _plan9_
    currenttime = plan9_msec();
#endif
}
コード例 #2
0
ファイル: timers.c プロジェクト: Jheengut/gmerlin
/*following functions are architecture dependent */
void
tl_update_time (void)
{
#ifdef __BEOS__
  currenttime = system_time ();
#else
#ifdef _WIN32
  QueryPerformanceCounter (&currenttime);
#else
#ifdef USE_ALLEGRO
  if (allegromode)
    {
      if (counter == -1)
	{
	  LOCK_VARIABLE (counter);
	  LOCK_FUNCTION (timer);
	  install_int (timer, 1000 / TICKSPERSEC);
	  ainstalled = 1;
	  counter = 0;
	}
      currenttime = counter;
      return;
    }
#endif
#ifdef HAVE_UCLOCK
  currenttime = uclock ();
#else
#ifdef USE_CLOCK
  currenttime = clock ();
#else
#ifdef HAVE_GETTIMEOFDAY

  do
    {
      gettimeofday (&currenttime, &tzp);
    }
  while (currenttime.tv_usec > 999999);
#else
#ifdef HAVE_FTIME
  ftime (&currenttime);
#endif
#endif
#endif
#endif
#endif
#endif
#ifdef _plan9_
  currenttime = plan9_msec ();
#endif
}