Ejemplo n.º 1
0
		u64 GetSystemTicks()
		{
#if defined ION_PLATFORM_WINDOWS
			LARGE_INTEGER ticks;
			if (!QueryPerformanceCounter(&ticks))
			{
				debug::Error("ion::time::GetSystemTicks() - QueryPerformanceCounter() failed");
			}
			return (u64)ticks.QuadPart;
#elif defined ION_PLATFORM_MACOSX
			timeval time;
			gettimeofday(&time, NULL);
			return (time.tv_sec * 1000000) + time.tv_usec;
#elif defined ION_PLATFORM_LINUX
			timeval time;
			gettimeofday(&time, NULL);
			return (time.tv_sec * 1000000) + time.tv_usec;
#elif defined ION_PLATFORM_RASPBERRYPI
			timeval time;
			gettimeofday(&time, NULL);
			return (time.tv_sec * 1000000) + time.tv_usec;
#elif defined ION_PLATFORM_DREAMCAST
			return timer_us_gettime64();
#endif
		}
Ejemplo n.º 2
0
uint64_t Profiler::current_time_in_us() const {
#ifdef _arch_dreamcast
    return timer_us_gettime64();
#else
    auto now = std::chrono::high_resolution_clock::now().time_since_epoch();
    return std::chrono::duration_cast<std::chrono::microseconds>(now).count();
#endif
}
Ejemplo n.º 3
0
void uae4all_prof_init(void)
{
	unsigned i;
#ifndef DREAMCAST
	unsigned long long s=SDL_GetTicks();
#else
	unsigned long long s=timer_us_gettime64();
#endif
	for(i=0;i<UAE4ALL_PROFILER_MAX;i++)
	{
		uae4all_prof_initial[i]=s;
		uae4all_prof_sum[i]=0;
		uae4all_prof_executed[i]=0;
		if (!uae4all_prof_total)
			uae4all_prof_msg[i]=NULL;
	}
	uae4all_prof_total_initial=s;
}