tinycc-devel
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
[Tinycc-devel] sleep() interprets argument as milliseconds instead of se
From
:
Hernán J . González
Subject
:
[Tinycc-devel] sleep() interprets argument as milliseconds instead of seconds
Date
:
Tue, 29 Nov 2016 16:52:44 -0300
The POSIX sleep() function ( <unistd.h>) should interpret is input argument as seconds.
TinyC seems to interpret it as milliseconds.
Using tcc version 0.9.26
/*******************************/
#include<stdio.h>
#include <unistd.h>
int main() {
int i;
fputs("Looping ...\n",stdout);
for(i=0;i<10;i++) {
fputs(".",stdout);
fflush(stdout);
sleep(3); // seconds?
}
return 0;
}
/*******************************/
Expected behaviour: This should print a dot at 3 seconds interval, the loop should take 30 seconds.
Result: The 10 dots are printed and the loop ends almost instanteously. Expected behaviour is attained when replacing '3' by '3000'
reply via email to
[Prev in Thread]
Current Thread
[
Next in Thread
]
[Tinycc-devel] sleep() interprets argument as milliseconds instead of seconds
,
Hernán J . González
<=
Re: [Tinycc-devel] sleep() interprets argument as milliseconds instead of seconds
,
Steven G. Messervey
,
2016/11/29
Prev by Date:
Re: [Tinycc-devel] Problem with libtcc DLL + MEMORY output
Next by Date:
Re: [Tinycc-devel] sleep() interprets argument as milliseconds instead of seconds
Previous by thread:
[Tinycc-devel] '__builtin_frame_address' warning about suspicious use of this call
Next by thread:
Re: [Tinycc-devel] sleep() interprets argument as milliseconds instead of seconds
Index(es):
Date
Thread