c - Execution of Sleep () in Xlib programming -
i have used sleep() in below section of code. however, surprise found sleep() executed first , 2 lines used printing pixels executed. means, getting both pixels printed out @ same time after 1 second wait in beginning. however, supposed this, print pixel, wait 1 second, , print next pixel. reason? well, writing x11 server display program.
#include<xlib.h> #include<sys/time.h> ---------------- other header files ---------------- int main () ------------variables , few lines of code x11 graphics xdrawpoint(.....); sleep(1); xdrawpoint(.....); ---------- few other stuffs end
xlib buffers requests (like drawing operations), , flushes buffer if necessary. can use xflush
after drawing first pixel.
Comments
Post a Comment