home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / source / library / timer.c < prev   
Encoding:
C/C++ Source or Header  |  1991-03-10  |  440 b   |  28 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. #include <sys/types.h>
  3. #include <sys/timeb.h>
  4. #include <stdio.h>
  5.  
  6. static double T_holder;
  7.  
  8. tinit()
  9.    {
  10.     struct timeb it;
  11.  
  12.     ftime(&it);
  13.     T_holder = it.time + (double)it.millitm / 1000;
  14. }
  15.  
  16. tick(A)
  17.     char *A;
  18.    {
  19.     struct timeb it;
  20.  
  21.     ftime(&it);
  22.     (void)printf("\t%s  running time is now %.2f\n", A,
  23.             (it.time + (double)it.millitm / 1000) - T_holder);
  24.    }
  25.  
  26.  
  27.  
  28.