LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2010, 07:27 AM   #1
linuxromeo
Member
 
Registered: Jun 2010
Posts: 45

Rep: Reputation: 15
Question Time in milliseconds


Hi

I want to get the time in milliseconds format.

Thanks in advance for your valuable help...
 
Old 06-25-2010, 07:33 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,672
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
http://linux.die.net/man/3/gettimeofday
 
Old 06-25-2010, 07:39 AM   #3
linuxromeo
Member
 
Registered: Jun 2010
Posts: 45

Original Poster
Rep: Reputation: 15
Thumbs down

Quote:
Originally Posted by anishakaul View Post
Sorry, for the thread being so brief,

Actually I want to get the time in millisecs ,in linux shell command,

how to use "date" (or any other shell command) for the same

Anyway thanks for your help.
 
1 members found this post helpful.
Old 06-25-2010, 08:01 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
how to use "date" (or any other shell command) for the same
man date or man command

Date as HH:MM:Nanoseconds is like this: date +%k:%M:%N

If you want milliseconds, just knock off the last three digits.

Why do you need this?
 
1 members found this post helpful.
Old 06-25-2010, 08:06 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,672
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by tredegar View Post
Date as HH:MM:Nanoseconds is like this: date +%k:%M:%N
If you want milliseconds, just knock off the last three digits.
Thanks , that was informative !
 
Old 06-25-2010, 08:12 AM   #6
linuxromeo
Member
 
Registered: Jun 2010
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
man date or man command

Date as HH:MM:Nanoseconds is like this: date +%k:%M:%N

If you want milliseconds, just knock off the last three digits.

Why do you need this?

thank you!!
 
Old 06-25-2010, 08:22 AM   #7
linuxromeo
Member
 
Registered: Jun 2010
Posts: 45

Original Poster
Rep: Reputation: 15
Cool

Quote:
Originally Posted by linuxromeo View Post
thank you!!
And for your information..for getting the millisecs...last 6 digits are to be knocked off..removing the last 3 digits will give you microseconds..ok..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to calculate time difference in milliseconds in C/C++ waqasdaar Programming 19 03-17-2009 05:02 PM
Current time in milliseconds charubcl Linux - Newbie 2 08-08-2008 06:28 AM
Time in milliseconds davidguygc Programming 2 04-25-2007 07:03 PM
C/C++ API for retrieving system time in micro or milliseconds syseeker Programming 1 05-04-2006 08:15 AM
calculate system clock in milliseconds bndpatel Linux - General 1 06-14-2005 12:25 PM


All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration