Compilers don't determine if there is a run-time error, they handle syntax errors only. A run-time error is, by definition, something caught at the time of running the program.
The few tools I've used for measuring program complexity have been pretty useless. They tended to work on simple programs but most of the code we put through them either broke them or solicited inane suggestions (I'm pretty certain our code is as complex as it needs to be, and no more). But, for measuring run-time and resource usage of programs, you have a wide variety. Probably the most common is the time
utility in UNIX and its brethren.
It actually runs the program inside a "wrapper" which measure elapsed and CPU times.
Alternatively, you can do on process accounting and collect all sorts of CPU, I/O and memory stats on all processes for later analysis.