Thread: Current System Time (In Milliseconds)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Quote Originally Posted by IGAU
    I do have <sys/timeb.h>, so I'm looking at ftime(), but I don't really understand it's application. I'm not an advanced programmer in any respects... Sorry to sound like a newbie or whatever, but can someone expand on it's use in plain English a bit for me?

    How about plain C:


    Code:
    #include <stdio.h>
    #include <sys/timeb.h>
    
    int main()
    {
      struct timeb tmb;
    
      ftime(&tmb);
      printf("tmb.time     = %ld (seconds)\n", tmb.time);
      printf("tmb.millitm  = %d (mlliseconds)\n", tmb.millitm);
    
      return 0;
    }
    Dave
    Last edited by Dave Evans; 03-30-2004 at 06:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending an email in C program
    By Moony in forum C Programming
    Replies: 28
    Last Post: 10-19-2006, 10:42 AM
  2. getting system time with better than a second resolution
    By sigfriedmcwild in forum C++ Programming
    Replies: 2
    Last Post: 01-21-2006, 08:05 AM
  3. GetSystemTime and my current time
    By Joelito in forum Windows Programming
    Replies: 2
    Last Post: 09-20-2005, 06:57 PM
  4. Extracting System Date and Time
    By AQWst in forum C++ Programming
    Replies: 2
    Last Post: 12-22-2004, 09:47 PM
  5. Passing system time to a function
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 02-14-2002, 01:56 PM