modified library function - added get resource waiting time