I'm using the following perl code on windows environment:
use Time::HiRes qw(usleep);
#(some code here)
$self->{GLOBAL_OBJ}->xsleep($delay) if($delay);
sub xsleep {
my $seconds = shift;
#print "will sleep:$seconds seconds\n";
$seconds = $seconds * 1000000;
usleep($seconds);
#print "slept:$seconds micro seconds\n";
return 0;
}
When I call xsleep like that (from another module) the system is stuck and I can only stop it by ctrl+c, however when I call it from the current module it works fine.
Can anyone tell me why this is and how can I fix it? Thanks