Visit Our UNIX and Linux User Community


useing date or other time style utility to get milliseconds.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers useing date or other time style utility to get milliseconds.
# 1  
Old 07-29-2002
useing date or other time style utility to get milliseconds.

hello everyone. im sure someone has run into the problem of timestamping files and end up haveing 2 files with the same name thus over writeing one of them.

In my application i am trying to get a timestamp w/ milliseconds but i am haveing no luck and finding an answer in the man pages.

I know i can use the random number to get a uniq filename but i am trying to stay away from that.

any help would be much appriacted.

i couldnt find anything in the date or strftime man pages.
# 2  
Old 07-29-2002
Nope, never had that problem. Too bad you aren't using VMS - it can do what you are looking for. But, since we aren't here to go back and forth (I actually like UNIX better than VMS) about OS's, this post may help you out. Check the link in it that Perderabo put in.

Sleep for milliseconds (may help you with files)
# 3  
Old 07-29-2002
This thread shows the C code for displaying time in microseconds. I think that might be more useful than sleeping would be.

And I agree that this is one area where Unix is showing its age. Unix keeps almost all of its timestamps in seconds. And these days, a second is a long time.
# 4  
Old 07-29-2002
thank you for the quick responses for something i should have searched for.

stupid me.

i asked another question about the code in the orignal thread.

https://www.unix.com/showthread.php?p...5370#post25370

Last edited by Optimus_P; 07-29-2002 at 03:01 PM..
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #529
Difficulty: Medium
256 possible ASCII characters are enough to represent the wide array of international characters when we consider languages like Chinese Japanese Korean (CJK).
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Milliseconds to Date in Sun OS 5.10

I am using Sun OS 5.10 I am Using nawk to extract specific column from csv file. The third column of csv is the time in Milliseconds and I need to convert it to Date then save it in another csv file. I am use this command to extract the columns I need and save it in tttn.csv nawk 'BEGIN... (6 Replies)
Discussion started by: Hozaifa
6 Replies

2. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies

3. Shell Programming and Scripting

Time Utility

I am looking at some practice problems from a book involving the time utility and I am a little confused on what to do. Here is what it is telling me to do: -Compile your sort: gcc -o sort1 sort1.c quicksort.c -For each input file, ins.n0000, get the time to execute: time sort1 <... (7 Replies)
Discussion started by: totoro125
7 Replies

4. Solaris

Process execution time in milliseconds

Hey everyone, I'm coming from Linux where the top command gave me lots of process info (particularly CPU time in milliseconds) and I'm trying to find similar info in Solaris. So far I've looked at prstat and ps but neither give cpu time in milliseconds, both seem to have 1 second... (2 Replies)
Discussion started by: maniac_ie
2 Replies

5. Shell Programming and Scripting

Getting Time in MilliSeconds with Perl

I use something like this in perl to get the date and time: use Time::localtime; use Time::gmtime; $tm = gmtime; $time_str = sprintf "%04d-%02d-%02d %02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; It gives me something like this: 2010-08-26... (1 Reply)
Discussion started by: lforum
1 Replies

6. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

7. Solaris

passing an input parameter like date thru jcl using BPXBATCH utility

Hi.... i need to pass the dates (from - to) as the input parameters thru jcl invoking BPXBATCH utility. I know that PARM will do the above functionality. But how the above dates passed through jcl will be linked in the java-db2 program to be used in sql queries in order to generate the report... (0 Replies)
Discussion started by: Sujatha Gowda
0 Replies

8. Shell Programming and Scripting

Convert milliseconds to standard time

hello, I have the uptime of the server showing as upTime=2427742050 How do I convert it to standard time. Thanks Chiru (1 Reply)
Discussion started by: chiru_h
1 Replies

9. Programming

C time in milliseconds function.

I need a c function which return the time in: hour min sec and mil sec I am writing on unix os. (3 Replies)
Discussion started by: kamil
3 Replies

Featured Tech Videos