GSDP:GAM100/CProcessing/CP System GetMillis()
From Inside
< GSDP:GAM100 | CProcessing
CP_System_GetMillis()
Description
Returns the total milliseconds from the start of the program.
NOTE: This number is always increasing and cannot be changed or reset by the user.
Example
void init(void)
{
// initialize settings
CP_Settings_TextSize(150);
CP_Settings_TextAlignment(CP_TEXT_ALIGN_H_CENTER, CP_TEXT_ALIGN_V_MIDDLE);
CP_Settings_Fill(CP_Color_Create(100, 20, 100, 255));
}
void update(void)
{
// clear the background
CP_Settings_Background(CP_Color_Create(200, 200, 200, 255));
// print milliseconds since program start
float totalMillis = CP_System_GetMillis();
char buffer[16] = { 0 };
sprintf_s(buffer, _countof(buffer), "%.1f", totalMillis);
CP_Font_DrawText(buffer, 200, 200);
}