In the C# 7.0 in a Nutshell book, I've read something that seems a bit confusing.
Unlike with the DomainUnload event, ProcessExit event handlers are timed: the default CLR host gives event handlers two seconds per domain, and three seconds in total, before terminating their threads.
(Chapter 24 - Page 956)
What does 2 Seconds mean for a Code block (i.e. event handler)?
Seems it depends on how much time is dedicated to the current process - as this 2 seconds is generally shared between processes by the OS.
So it's indeterministic that how much work is allowed to be done in the "process exit event handler" before the process is killed.