nfs-ganesha 1.4
|
00001 /* 00002 * vim:expandtab:shiftwidth=8:tabstop=8: 00003 * 00004 * Copyright CEA/DAM/DIF (2008) 00005 * contributeur : Philippe DENIEL philippe.deniel@cea.fr 00006 * Thomas LEIBOVICI thomas.leibovici@cea.fr 00007 * 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 3 of the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * --------------------------------------- 00024 * Mesure de temps: Exemple d'utilisation 00025 * 00026 * $Header: /cea/home/cvs/cvs/SHERPA/BaseCvs/GANESHA/src/test/test_mesure_temps.c,v 1.4 2005/11/28 17:03:05 deniel Exp $ 00027 * 00028 * $Log: test_mesure_temps.c,v $ 00029 * 00030 * Revision 1.3 2005/08/12 07:11:17 deniel 00031 * Corrected cache_inode_readdir semantics 00032 * 00033 * Revision 1.2 2004/08/19 08:08:12 deniel 00034 * Mise au carre des tests sur les libs dynamiques et insertions des mesures 00035 * de temps dans les tests 00036 * 00037 * 00038 */ 00039 00040 #include <unistd.h> 00041 #include <stdio.h> 00042 #include <stdlib.h> 00043 #include <sys/types.h> 00044 #include <sys/times.h> 00045 #include "MesureTemps.h" 00046 00047 #define DUREE 3 00048 00049 int main(int argc, char *argv[]) 00050 { 00051 struct Temps debut, fin; 00052 00053 printf("J'attends volontairement %d secondes pour verifier la routine de mesure\n", 00054 DUREE); 00055 00056 MesureTemps(&debut, NULL); 00057 sleep(DUREE); 00058 MesureTemps(&fin, &debut); 00059 00060 printf("duree allocation %s s\n", ConvertiTempsChaine(fin, NULL)); 00061 00062 exit(0); 00063 }