473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

getting current timestamp in micro secs

Hi,
I want to find the current time stamp in micro sec precision.

The requirement is,
my function is executed in an infinite loop.
I measure a value and check if the value computed is what i expected
9forget all this stuff).
I want to print the time stamp every time that event occurs.

So my requirement is printing the current timestamps.

so I can calculate the average time (in micro secs) after which such
an event occur...

I hope I made my requirement clear.

Can anybody pls help me with this problem.
I searched many discussion but couldn't find satisfactory answer.

thanks in advance
Sep 18 '08 #1
2 4818
Ashit Vora <a.******@gmail.comwrote:
Hi,
I want to find the current time stamp in micro sec precision.

The requirement is,
my function is executed in an infinite loop.
I measure a value and check if the value computed is what i expected
9forget all this stuff).
I want to print the time stamp every time that event occurs.

So my requirement is printing the current timestamps.

so I can calculate the average time (in micro secs) after which such
an event occur...

I hope I made my requirement clear.

Can anybody pls help me with this problem.
I searched many discussion but couldn't find satisfactory answer.

thanks in advance
There is no portable way of doing that, so you will have to use some
system-specific method to do it.
If you are using some Unix-like system, then you will probably have
gettimeofday() available. Beware though that even if it does return a value
in microseconds it will on, most systems, not be accurate to more than 10ms
or so.

If you actually need microsecond precision then whatever method you may
find, will be highly specific to your particular system and not at all
portable.


--
<Insert your favourite quote here.>
Erik Trulsson
er******@student.uu.se
Sep 18 '08 #2
On 18 Sep, 07:35, Ashit Vora <a.k.v...@gmail.comwrote:
I want to find the current time stamp in micro sec precision.

The requirement is,
my function is executed in an infinite loop.
I measure a value and check if the value computed is what i expected
9forget all this stuff).
I want to print the time stamp every time that event occurs.

So my requirement is printing the current timestamps.

so I can calculate the average time (in micro secs) after which such
an event occur...

I hope I made my requirement clear.

Can anybody pls help me with this problem.
I searched many discussion but couldn't find satisfactory answer.

thanks in advance
you've already been told the answer to this.
Why did you post again?

--
Nick Keighley

Sep 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob | last post by:
Trying to convert timestamp data to date data (without the time in hours/mins/secs), does only seem to work with TO_DATE(mydate; 'yyyymmdd'). But I do not want a string, but a real date like...
1
by: George Develekos | last post by:
I need to import into mysql data from DB2. One of the DB2 table columns is of the TIMESTAMP type, which, unlike its MySQL counterpart, supports fractions of a second, up to 6 digits, i.e. it is of...
8
by: Chris | last post by:
Sorry, This should be simple, but brain is hurting... How do I convert a Current Time to a Decimal 6,0 (HMS)? There must be a cleaner way then this: Insert into Table Values Dec(...
5
by: David Requena | last post by:
Hi All, I'm trying to parse a file which has some timestamps embedded. These're expressed as a number of seconds elapsed since 01/01/1904 (macintosh time). I know OS X provides some APIs to...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
3
by: Zhaohui | last post by:
hello everyone: How can I get local timestamp use c++/c, I only know is time(), but time() returns a UTC timestamp, I want get local timestamp, how can I do, I am under windows system. ...
11
by: singlal | last post by:
Hi, I am currently using DAYOFWEEK function and putting CASE statement to get english day name. For example: SELECT CASE DAYOFWEEK(CURRENT DATE) WHEN 1 THEN 'SUNDAY' WHEN 2 THEN 'MONDAY'
2
cassbiz
by: cassbiz | last post by:
I am using strtotime and I have read up on some examples and am getting the wrong output, it jumps by several days instead of one day at a time. Ultimately what I am trying to accomplish is to set...
30
by: Ashit Vora | last post by:
Hi, I want to find the current time stamp in micro sec precision. The requirement is, my function is executed in an infinite loop. I measure a value and check if the value computed is what i...
1
by: Neel | last post by:
Hi, I want to find the current time stamp in micro sec precision. The requirement is, my function is executed in an infinite loop. I measure a value and check if the value computed is what i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.