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.
Customer surveys are for companies who didn't pay proper attention to begin with.