bool IsDebugged(DWORD dwNativeElapsed) { DWORD dwStart = GetTickCount(); // ... some work return (GetTickCount() - dwStart) > dwNativeElapsed; }