void MainTask(void) { int Cnt; int TestTime; GUI_Init(); while(1) { Cnt = 0; TestTime = GUI_GetTime() + 1000; while ((TestTime - GUI_GetTime()) >= 0) { _CalcPrimes(sizeof(_aIsPrime)); Cnt++; } _PrintResult(Cnt); } }
/********************************************************************* * * HPTask */ static void HPTask(void) { int Cnt; int TestTime; while(1) { Cnt = 0; OS_Delay(1); // Sync to tick TestTime = OS_GetTime32() + 1000; while ((TestTime - OS_GetTime()) >= 0) { _CalcPrimes(sizeof(aIsPrime)); Cnt++; } _PrintResult(Cnt); } }