How to detect if a process is being debugged?

Hello,

I wonder… (how) is it possible for a process to detect if it’s being debugged?

This is a very curious question. Obviously, you could put timing checks, and if the time between two points in the program is too long, you could suspect a debugger. The flip side, is that short of timing issues, a debugger is supposed to be a non-quantum-mechanical observer, one that does not disturb the process by observing it. So your request, while likely possible, is in opposition to the purpose of a debugger.