That's system-dependent, and thus not available in Java code. A browser's not a computing task, so "idle time" is a fairly meaningless concept. About as close as makes sense in a Java context is being concerned about Java Virtual Machines that go CPU-bound. This is normally something you use profilers and performance monitors to address.
An IDE is no substitute for an Intelligent Developer.