473,378 Members | 1,631 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,378 software developers and data experts.

getting time in milliseconds

Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .

Regards
Mangesh .

Apr 23 '06 #1
3 5982
Markus Schoder wrote:
mangesh wrote:
Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .


There is a C++ standard function called time() but it only has second
resolution.


This is not correct. From the C draft standard:

7.23.2.4 The time function

Description

[#2] The time function determines the current calendar time.
The encoding of the value is unspecified.

Returns

[#3] The time function returns the implementation's best
approximation to the current calendar time. The value
(time_t)-1 is returned if the calendar time is not
available. If timer is not a null pointer, the return value
is also assigned to the object it points to.


Brian
Apr 23 '06 #2
In article <11*********************@g10g2000cwb.googlegroups. com>,
"mangesh" <ma************@walla.com> wrote:
Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .


If you want to keep it standard:

Look up "clock()", the best resolution the standard can give you is
1/CLK_TCK second

http://www.cplusplus.com/ref/ctime/
Apr 25 '06 #3
In article <postmaster-1CF23A.23055224042006
@news.east.earthlink.net>, po********@verizon.net says...

[ ... ]
Look up "clock()", the best resolution the standard can give you is
1/CLK_TCK second


I suppose that depends on which standard you follow.
CLK_TCK is (if memory serves) in the POSIX standard, but
the C and C++ standards call it CLOCKS_PER_SEC.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Apr 26 '06 #4

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

Similar topics

10
by: Andreas | last post by:
Hi! Is it possible to get a time event at a specific time, for instance eight a'clock? My program is running in the background and is minimized to the tray bar. If not, is there a smooth way...
15
by: mjs7231 | last post by:
I am trying to record how long an operation takes, but can't seem to find a function that will allow me to record the timestamp in milliseconds, maybe I am looking in the wrong place?
6
by: Thomas Baier | last post by:
Hi there, I need to know how to get the elapsed time in milliseconds. I tried time_t start,end; time(start); do_something(); time(end); double dif = difftime(end, start);
26
by: Pravesh | last post by:
Hi: is there a way to get current system time in milliseconds... which functions and headers?? thanks pravesh
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
12
by: Spitfire | last post by:
I've a requirement to find the elapsed time between two function calls. I need to find the time elapsed accurate to 1 millisecond. The problem I'm facing right now is that, I'm using the 'time()'...
2
by: jessica6_2000 | last post by:
I have a page where I need to display the unix time (seconds) upon page load. I've found many complex examples that auto update, count live, etc., but I need to just display the time at the time...
1
by: ndedhia1 | last post by:
I was reading in a log file like this that had no milliseconds: QuoteBlockTiming exceeded 1 ms: 1 --- Thu Dec 10 02:01:40 CST 2009 170.137.15.155 Class key = 601650761 block size QuoteBlockTiming...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.