00001 /* Implémentation Linux de la bibliotheque XADLL de Sidena 00002 * Copyright (C) 2005 ENSTAR 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * You can contact us: 00019 * Association ENSTAR 00020 * Ecole Nationale Superieure de Techniques Avancees 00021 * 32 boulevard Victor 00022 * 75739 Paris Cedex 15 00023 * FRANCE 00024 * 00025 * enstar@ensta.fr 00026 */ 00027 00028 /** @file exec_test.c 00029 * @brief Programme de test 00030 * @author Francois Fevotte <francois.fevotte@ensta.org> 00031 * $Revision: 81 $ 00032 * $Date: 2006-03-23 15:41:38 +0100 (Thu, 23 Mar 2006) $ 00033 */ 00034 00035 /* $Id: exec_test.c 81 2006-03-23 14:41:38Z francois $ */ 00036 00037 #include "xalib.h" 00038 #include <unistd.h> 00039 #include <string.h> 00040 #include <time.h> 00041 #include <stdio.h> 00042 00043 int main() 00044 { 00045 int i, nbInstr; 00046 time_t t1,t2; 00047 00048 XA_startup(); 00049 00050 printf("Maintenant on commence a compter\n"); 00051 nbInstr = 0; 00052 for(time(&t1) ; time(NULL)<t1+10 ; ) 00053 { 00054 XAN(LEDON, 8, 0,0,0,0,0); nbInstr++; /* allumer DEL*/ 00055 XAN(LEDOFF, 8, 0,0,0,0,0); nbInstr++; /* Eteindre DEL */ 00056 } 00057 time(&t2); 00058 00059 printf("%d instructions, %d secondes\n", nbInstr, t2-t1); 00060 00061 XA_cleanup(); 00062 return nbInstr; 00063 }