+void wait_vsync()
+{
+ unsigned long arg = 0;
+
+ timeval tvstart, tvend;
+ gettimeofday(&tvstart, 0);
+
+ if(ioctl(dev_fd, FBIO_WAITFORVSYNC, &arg) == -1) {
+ printf("ioctl error %s\n", strerror(errno));
+ }
+
+ gettimeofday(&tvend, 0);
+ printf("%ld %ld\n", tvend.tv_sec - tvstart.tv_sec, tvend.tv_usec - tvstart.tv_usec);
+}
+