Exemple #1
0
void checkRtcTickAddYears()
{
	printf("Checking checkRtcTickAddYears\n");

	u64 sourceTick = 62135596800000445ULL;
	u64 destTick = 0;
	pspTime pt;

	printf("62135596800000445 adding -2000 years: %08x\n", sceRtcTickAddYears(&destTick, &sourceTick, -2000));
	printf("source tick %llu\n", sourceTick);
	sceRtcSetTick(&pt, &sourceTick);
	printf("%d, %d, %d, %d, %d, %d, %d\n", pt.year, pt.month, pt.day, pt.hour, pt.minutes, pt.seconds, pt.microseconds);

	printf("dest tick  %llu\n", destTick);
	sceRtcSetTick(&pt, &destTick);
	printf("%d, %d, %d, %d, %d, %d, %d\n", pt.year, pt.month, pt.day, pt.hour, pt.minutes, pt.seconds, pt.microseconds);

	sourceTick = 62135596800000445ULL;
	destTick = 0;

	printf("62135596800000445 adding +2000 years: %08x\n", sceRtcTickAddYears(&destTick, &sourceTick, 2000));
	printf("source tick  %llu\n", sourceTick);
	sceRtcSetTick(&pt, &sourceTick);
	printf("%d, %d, %d, %d, %d, %d, %d\n", pt.year, pt.month, pt.day, pt.hour, pt.minutes, pt.seconds, pt.microseconds);

	printf("dest tick  %llu\n", destTick);
	sceRtcSetTick(&pt, &destTick);
	printf("%d, %d, %d, %d, %d, %d, %d\n", pt.year, pt.month, pt.day, pt.hour, pt.minutes, pt.seconds, pt.microseconds);

}
UInt64 SystemInfo::GetCpuCycles()
{
    UInt64 ticks;
    int res = sceRtcGetCurrentTick(&ticks);
    GD_ASSERT(res == 0);

    res = sceRtcTickAddYears (&ticks,&ticks,-2000);
    GD_ASSERT(res == 0);

    return ticks;
}