Main Page   File List   Globals  

tests/test3.c

00001 /***************************************************************************
00002                     test3.c  -  test clear_screen speed
00003                              -------------------
00004     begin                : Sat Feb 16 2002
00005     copyright            : (C) 2000 by Daniele Venzano
00006     email                : webvenza@libero.it
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; version 2 of the License.               *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #include "FBlib.h"
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <time.h>
00020 
00021 #define MAX_SECS 30
00022 #define UPDATE_INTERVAL 5
00023 
00024 int main()
00025 {
00026         int i;
00027         long elapsed_time;
00028         
00029         FB_initlib("/dev/fb0");
00030         elapsed_time = time(NULL);
00031         for(i=255; i>=0; i--)
00032                 FB_clear_screen(FB_makecol(i,0,0,0));
00033         elapsed_time = time(NULL) - elapsed_time;
00034         FB_exit();
00035         printf("The screen has been filled 256 times in %d seconds, it's %g clears/s\n", (int)elapsed_time, (double)256/elapsed_time);
00036         return 0;
00037 }

Generated on Sat Jul 5 09:04:51 2003 for LibFB by doxygen1.2.18