Skip to content

Instantly share code, notes, and snippets.

View Alperyu9ae's full-sized avatar
💭
I may be slow to respond.

alperyu9ae Alperyu9ae

💭
I may be slow to respond.
  • E Company
View GitHub Profile
#include <windows.h>
#include <cstdlib>
#include <ctime>
#include <conio.h> // for _kbhit() and _getch()
void drawShapes(HDC hdc, int duration_ms) {
srand(static_cast<unsigned>(time(0)));
DWORD start = GetTickCount();
while (GetTickCount() - start < duration_ms) {
if (_kbhit() && _getch() == 'f') return; // Stop if F is pressed