monorepo
This commit is contained in:
21
P1/smt4497-P1/smt4497-P1a.cpp
Normal file
21
P1/smt4497-P1/smt4497-P1a.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "smt4497-P1.h"
|
||||
|
||||
int esperaPulseTecla(int toutMs)
|
||||
{
|
||||
int res = 0;
|
||||
int antes = GetTickCount();
|
||||
int ahora;
|
||||
|
||||
do {
|
||||
if (_kbhit())
|
||||
{
|
||||
res = _getch();
|
||||
break;
|
||||
}
|
||||
if (toutMs > 0)
|
||||
Sleep(1);
|
||||
ahora = GetTickCount();
|
||||
} while (ahora - antes < toutMs);
|
||||
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user