I have been searching the internet trying to find the definition for the
function time() in the standard library header <ctime>. Can someone help me
with this? Thanks in advance. 8 4182
B Williams wrote:
I have been searching the internet trying to find the definition for the
function time() in the standard library header <ctime>. Can someone help me
with this? Thanks in advance.
std::clock_t std::time(std::clock_t * tloc) ;
Returns the number of seconds since the Epoch (midnight, Jan 1, 1970).
If tloc is not NULL, it also writes the same value to the location
provided by the parameter.
--
Alan Johnson
"Alan Johnson" <al****@no.spam.stanford.eduwrote in message
news:e8**********@news.Stanford.EDU...
>B Williams wrote:
>I have been searching the internet trying to find the definition for the function time() in the standard library header <ctime>. Can someone help me with this? Thanks in advance.
std::clock_t std::time(std::clock_t * tloc) ;
Returns the number of seconds since the Epoch (midnight, Jan 1, 1970). If
tloc is not NULL, it also writes the same value to the location provided
by the parameter.
--
Alan Johnson
Thanks Alan,
I really appreciate it.
B Williams wrote:
I have been searching the internet trying to find the definition for
the function time() in the standard library header <ctime>. Can
someone help me with this? Thanks in advance.
What do you mean by "definition"?
Brian
On Sun, 09 Jul 2006 18:59:09 -0700, Alan Johnson
<al****@no.spam.stanford.eduwrote in comp.lang.c++:
B Williams wrote:
I have been searching the internet trying to find the definition for the
function time() in the standard library header <ctime>. Can someone help me
with this? Thanks in advance.
std::clock_t std::time(std::clock_t * tloc) ;
Returns the number of seconds since the Epoch (midnight, Jan 1, 1970).
If tloc is not NULL, it also writes the same value to the location
provided by the parameter.
time() returns type time_t.
clock() returns type clock_t.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jack Klein wrote:
On Sun, 09 Jul 2006 18:59:09 -0700, Alan Johnson
<al****@no.spam.stanford.eduwrote in comp.lang.c++:
>B Williams wrote:
>>I have been searching the internet trying to find the definition for the function time() in the standard library header <ctime>. Can someone help me with this? Thanks in advance.
std::clock_t std::time(std::clock_t * tloc) ;
Returns the number of seconds since the Epoch (midnight, Jan 1, 1970). If tloc is not NULL, it also writes the same value to the location provided by the parameter.
time() returns type time_t.
clock() returns type clock_t.
Correct. Apologies for the misinformation.
--
Alan Johnson
Alan Johnson wrote:
B Williams wrote:
I have been searching the internet trying to find the definition
for the function time() in the standard library header <ctime>.
Can someone help me with this? Thanks in advance.
std::clock_t std::time(std::clock_t * tloc) ;
Returns the number of seconds since the Epoch (midnight, Jan 1,
1970). If tloc is not NULL, it also writes the same value to the
location provided by the parameter.
As Jack mentioned, this is the wrong declaration. You are also
incorrect in the semantics. There's no requirement that time() return
seconds, certainly not seconds since the epoch. That happens to be
common, but portable should not rely on that or need that.
Brian
You can locate the ctime header file using "locate" or "find" commands
on UNIX
Thanks and regards
SJ
Default User wrote:
B Williams wrote:
I have been searching the internet trying to find the definition for
the function time() in the standard library header <ctime>. Can
someone help me with this? Thanks in advance.
What do you mean by "definition"?
Brian
Default User wrote:
>
As Jack mentioned, this is the wrong declaration. You are also
incorrect in the semantics. There's no requirement that time() return
seconds, certainly not seconds since the epoch. That happens to be
common, but portable should not rely on that or need that.
Correct, time_t's encoding is not specified. All you can do is
pass it to otherf unctions. If you want to know elapsed time
from some point, use difftime(). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ernst Murnleitner |
last post by:
Hello Readers,
I am looking for a replacement of <ctime>.
for the functions
gmtime
mktime
One reason is, that these time functions use statically allocated memory but
|
by: Danny Anderson |
last post by:
Hola!
I am working on a program where I am including a library that came with my
numerical methods textbook. The "util.h" simply includes a large number
of files. I had to change the util.h...
|
by: Charles L |
last post by:
I have read that the inclusion of <fstream.h> makes the inclusion of
<iostream.h> unnecessary.
Is this correct?
Charles L
|
by: Matthias Kaeppler |
last post by:
Hi,
why can I use assert from <cassert> without resolving the std::
namespace? E.g.:
#include <cassert>
int main()
{
assert(true); // shouldn't this be: std::assert(true) ?
|
by: Peter Jansson |
last post by:
Dear group,
I have been struggling to get a simple program for inserting and
extracting std::tm objects to/from streams to work. The code below tries
to read a std::tm object from a...
|
by: Simple Simon |
last post by:
Java longs are 8 bytes. I have a Java long that is coming in from
the network, and that represents milliseconds since Epoch (Jan 1 1970
00:00:00). I'm having trouble understanding how to get it...
|
by: Magesh |
last post by:
How date-time attributes of a file are represented in the structure
"struct stat"? Coz as I noted they found to be unsigned integers and I
donno how they are interpreted as date & time in the...
|
by: Mike Copeland |
last post by:
I'm having difficulty updating map objects. In the code I've
excerpted below, I store map objects without difficulty, but my attempts
to modify elements of the stored data don't work.
struct...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
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...
| |