File:  [HATARI the Atari ST Emulator] / hatari / src / timer.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Mon Apr 1 07:09:33 2019 UTC (7 years, 2 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari00020, hatari00011, HEAD
hatari 0.11

/*
  Hatari

  Debug Timer functions
*/

#include "main.h"

#define LARGE_INTEGER long long  /* ???? */
#define LONGLONG long long       /* ???? */

#define QueryPerformanceFrequency(x)  /* FIXME: What the !$*? is this? */
#define QueryPerformanceCounter(x)    /* Dito */


LARGE_INTEGER StartCount,EndCount,Frequency;


/*-----------------------------------------------------------------------*/
/*
  Initialise debug timer
*/
void Timer_Init(void)
{
#ifdef FIND_PERFORMANCE
  /* Find frequency to calculate 'milli-second' results */
  QueryPerformanceFrequency(&Frequency);
#endif
}


/*-----------------------------------------------------------------------*/
/*
  Start timer
*/
void Timer_Start()
{
  /* Start timer */
  QueryPerformanceCounter(&StartCount);
}


/*-----------------------------------------------------------------------*/
/*
  Stop timer, return as 'milli-second' count(float)
*/
float Timer_Stop()
{
  LONGLONG a,b;

  /* End timer */
  QueryPerformanceCounter(&EndCount);

  /* Find time and frequency */
  a = EndCount /*.QuadPart*/ - StartCount /*.QuadPart*/;  /* FIXME */
  b = Frequency /*.QuadPart*/ ;

  return( ((float)a/(float)b) * 1000.0f );  /* as 'ms' */
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.