sample code for HangTime