home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / dev / c / cmanual / intuition / miscellaneous / example5.c < prev    next >
C/C++ Source or Header  |  1993-10-12  |  2KB  |  55 lines

  1. /***********************************************************/
  2. /*                                                         */
  3. /* Amiga C Encyclopedia (ACE) V3.0      Amiga C Club (ACC) */
  4. /* -------------------------------      ------------------ */
  5. /*                                                         */
  6. /* Book:    ACM Intuition               Amiga C Club       */
  7. /* Chapter: Miscellaneous               Tulevagen 22       */
  8. /* File:    Example5.c                  181 41  LIDINGO    */
  9. /* Author:  Anders Bjerin               SWEDEN             */
  10. /* Date:    92-05-01                                       */
  11. /* Version: 1.10                                           */
  12. /*                                                         */
  13. /*   Copyright 1992, Anders Bjerin - Amiga C Club (ACC)    */
  14. /*                                                         */
  15. /* Registered members may use this program freely in their */
  16. /*     own commercial/noncommercial programs/articles.     */
  17. /*                                                         */
  18. /***********************************************************/
  19.  
  20. /* This example prints out the current time. */
  21.  
  22.  
  23. #include <intuition/intuition.h>
  24.  
  25.  
  26. struct IntuitionBase *IntuitionBase;
  27.  
  28.  
  29. main()
  30. {
  31.   ULONG seconds, micros;
  32.  
  33.  
  34.  
  35.   /* Open the Intuition Library: */
  36.   IntuitionBase = (struct IntuitionBase *)
  37.     OpenLibrary( "intuition.library", 0 );
  38.   
  39.   if( IntuitionBase == NULL )
  40.     exit(); /* Could NOT open the Intuition Library! */
  41.  
  42.  
  43.  
  44.   /* Get the current time: */
  45.   CurrentTime( &seconds, µs );
  46.  
  47.   /* Print out the current time: */
  48.   printf( "Seconds: %d\n", seconds );
  49.   printf( "Micros:  %d\n", micros );
  50.  
  51.  
  52.  
  53.   /* Close the Intuition Library: */
  54.   CloseLibrary( IntuitionBase );
  55. }