473,472 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

time in c++

I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.
Jul 23 '05 #1
3 1371
Theron NightStar wrote:

I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


did you try <ctime> ?

time.h is a leftover from the C grandparent of C++.
The C++ version of those headers usually have a 'c'
in front of them to remind you of that fact.
--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2
Karl Heinz Buchegger wrote:
Theron NightStar wrote:

I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


did you try <ctime> ?

time.h is a leftover from the C grandparent of C++.
The C++ version of those headers usually have a 'c'
in front of them to remind you of that fact.


lol sorry - that simply made too much sense - thanks
Jul 23 '05 #3
Theron NightStar wrote:
I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


C standard header <x.h>
replaced by
C++ standard header <cx>

--
imalone
Jul 23 '05 #4

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

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.