You can use System.currentTimeMillis();to get the current system time in Java (in milliseconds from 01-01-1970 00:00:00 GMT).
The session object most likely also has a method to get the time when the last session was used (see the API documentation for any session object used).
Cross out the current time from now on from the session, and you know how much time has passed since the last session was used. If it is longer than the waiting period, do whatever you need.
, , . , HttpRequest.getSession() HttpSession, .