I have JVM option -XX:+PrintGCApplicationStoppedTime which prints real "GC stop the world time".
Example:
- Total time for which application threads were stopped: 0.0018219 seconds
- Total time for which application threads were stopped: 0.0016542 seconds
- Total time for which application threads were stopped: 0.0015797 seconds
I need to calculate "GC stop the world" by java code. How can I do it ?