cast msec parameter to long in nanosleep()