Added a new timed function in nx_event_queue, had to make a few changes in the wait condition to make it work as expected