The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
display TIME - help iamcool Shell Programming and Scripting 2 02-08-2008 01:15 PM
date and time to display on the terminal cesarNZ Shell Programming and Scripting 11 09-05-2007 04:19 PM
how to display time in minutes n seconds... santy Shell Programming and Scripting 1 08-23-2006 07:18 AM
How Can I Display Unix Path All The Time murli1200 UNIX for Dummies Questions & Answers 1 08-17-2006 02:05 PM
display date n Time SsRrIi SUN Solaris 1 03-16-2006 02:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2002
Registered User
 

Join Date: Jan 2002
Posts: 2
Question Help! Display Time with Millisecond

Hi All,
Urgent! Just a newbie needing advice.

Has anybody have a sample C script code in Unix to display time with milliseconds?

Most of the research I'm doing is up to the seconds format only.

Thanks!
Leidail
Reply With Quote
Forum Sponsor
  #2  
Old 01-22-2002
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,483
Try these links and quotes and see if they help your research:

http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?timers+5

Quote:
time() returns milliseconds since Jan 1, 1970. This number will not overflow any integer wheels until July 8, 2038 (at 03:14:07 UTC if you want to time it). By then, I fully expect everyone to be on at least 64-bit platforms, which means it will cease to matter until well after we're dead and gone. No one EVER writes code that "only looks at the first 9 digits" because hardly anyone ever even uses the "real" value of time(). It is usually converted into a human-readable form with the localtime() function."
From thread:

http://www.sunmanagers.org/pipermail...ly/001059.html

Others can be found at www.google.com using the keywords:

UNIX time milliseconds
Reply With Quote
  #3  
Old 01-23-2002
Registered User
 

Join Date: Jan 2002
Posts: 2
Thanks for your advice!
I was able to find one source code that display milliseconds!

If anyone else is interested, it is here:
http://www.meangene.com/notes/time.html
Reply With Quote
  #4  
Old 01-26-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,658
Yeah, but ftime() has been obsolete for decades. I certainly wouldn't use it for new code. Here is a thread showing how to display time in microseconds. I'm sure that you can convert microseconds to milliseconds.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0