home *** CD-ROM | disk | FTP | other *** search
- /*
- * getsec.c
- * Purpose: returns time since midnight in hundredths of a second
- *
- * Jeremy D. Freeman
- * Copyright MicroWay, Inc 1989
- *
- */
-
- #include <stdio.h>
- #include <time.h>
-
- extern int centisec;
- extern float getsec100(); /* forward reference */
-
- mainiac ()
-
- {
- float a, b;
- int i;
-
- a = getsec100();
- printf ("a = %f\n",(double) a);
- for (i=0;i < 100000; i++) {
- ;
- }
- b = getsec100();
- printf ("b = %f\n",(double) b);
- printf ("\n");
-
- }
-
-
- float getsec100()
-
- {
- struct tm *tmp;
-
- tmp = localtime();
- return((3600*tmp->tm_hour+60*tmp->tm_min+tmp->tm_sec)*100+centisec);
-
- }
-
-