/* -*- Mode: C -*- * * $Header: /home/gene/library/website/docsrc/lotdll/src/src/RCS/go.c,v 395.1 2008/04/20 17:25:55 gene Exp $ * * Copyright (c) 2006 Gene Michael Stover. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ #include "this.h" /* */ static struct { int count; double seconds; } S_a[] = { { 1, 0.0 }, { 10, 0.0 }, { 100, 0.0 }, { 1000, 0.0 } }; static int S_alen = sizeof S_a / sizeof S_a[0]; /* */ static double S_Test (int n) { time_t tt; char cmd[100]; sprintf (cmd, ".\\prog%04d", n); time (&tt); if (system (cmd) != 0) { printf ("\n%s:%d: \"%s\" failed", __FILE__, __LINE__, cmd); abort (); } return difftime (time (NULL), tt); } /* */ static void S_Print () { int i; for (i = 0; i < S_alen; ++i) { printf ("\n%4d %.2e", S_a[i].count, S_a[i].seconds); } } int main () { int rc = 0, i; for (i = 0; i < S_alen; ++i) { S_a[i].seconds = S_Test (S_a[i].count); } S_Print (); return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } /* --- end of file --- */