Chapter4: Example7: added service thread sleep