Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 4, 2019 11:46
Show Gist options
  • Save surinoel/4990ba46bc00b1b7896c716ebbda13fd to your computer and use it in GitHub Desktop.
Save surinoel/4990ba46bc00b1b7896c716ebbda13fd to your computer and use it in GitHub Desktop.
static void error_handler(long long sec, char msg1[], char msg2[])
{
long long curtimetick, flagtick;
curtimetick = clock();
flagtick = curtimetick / CLOCKS_PER_SEC;
system("cls");
printf("\n\n\n\n\n\n\n\n\n\n"); printf("\t\t\t\t\t# "); printf("%s\n", msg1);
printf("\t\t\t\t\t# "); printf("%lld초 안에 %s\n", sec - (clock() - curtimetick) / CLOCKS_PER_SEC, msg2);
while ((clock() - curtimetick) / CLOCKS_PER_SEC < sec) {
if (flagtick != (clock() - curtimetick) / CLOCKS_PER_SEC) {
flagtick = (clock() - curtimetick) / CLOCKS_PER_SEC;
system("cls");
printf("\n\n\n\n\n\n\n\n\n\n"); printf("\t\t\t\t\t# "); printf("%s\n", msg1);
printf("\t\t\t\t\t# "); printf("%lld초 안에 %s\n", sec - (clock() - curtimetick) / CLOCKS_PER_SEC, msg2);
}
}
system("cls");
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment