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

_TIME_

Hi,
Could you please let me know how to use _TIME_ macro with a
sample code?

Regards
Aug 6 '08 #1
8 5120
ramu wrote:
Hi,
Could you please let me know how to use _TIME_ macro with a
sample code?
#include <stdio.h>

int main(void)
{
puts(__TIME__);
}

--
Ian Collins.
Aug 6 '08 #2
On Aug 6, 6:49*pm, ramu <ramu....@gmail.comwrote:
Hi,
* * * *Could you please let me know how to use _TIME_ macro with a
sample code?

Regards
It's __TIME__, with 4 underscores:

#include <stdio.h>

int main (void) {
puts(__TIME__);
return 0;
}

--
Robert Gamble
Aug 6 '08 #3
Ian Collins wrote:
ramu wrote:
>Could you please let me know how to use _TIME_ macro with a
sample code?

#include <stdio.h>
int main(void) {
puts(__TIME__);
}
Reading the (easily available) standard is much faster. I.e:

6.10.8 Predefined macro names

[#1] The following macro names shall be defined by the
implementation:

.... snip ...

__TIME__ The time of translation of the source file: a
character string literal of the form "hh:mm:ss" as
in the time generated by the asctime function. If
the time of translation is not available, an
implementation-defined valid time shall be
supplied.

Some useful references about C:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://c-faq.com/ (C-faq)
<http://benpfaff.org/writings/clc/off-topic.html>
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf(C99)
<http://cbfalconer.home.att.net/download/n869_txt.bz2(C99, txt)
<http://www.dinkumware.com/c99.aspx (C-library}
<http://gcc.gnu.org/onlinedocs/ (GNU docs)
<http://clc-wiki.net/wiki/C_community:comp.lang.c:Introduction>

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

Aug 7 '08 #4
CBFalconer wrote:
Ian Collins wrote:
>ramu wrote:
>>Could you please let me know how to use _TIME_ macro with a
sample code?

#include <stdio.h>
int main(void) {
puts(__TIME__);
}

Reading the (easily available) standard is much faster. I.e:

The Standard isn't easily available at all from the perspective of a
beginner. Even the existence of a Standard, it's Committee's website,
and the presence of public drafts is unknown to the vast majority of
newbies. Besides, the Standard document (or the draft) is _not_ a good
place for a newbie to seek help. He would be much better off with
almost any decent C book or tutorial.
6.10.8 Predefined macro names

[#1] The following macro names shall be defined by the
implementation:

... snip ...

__TIME__ The time of translation of the source file: a
character string literal of the form "hh:mm:ss" as
in the time generated by the asctime function. If
the time of translation is not available, an
implementation-defined valid time shall be
supplied.
This would be most opaque to someone just starting out with C. Terms
like "implementation", "translation", "character string
literal", "asctime", "implementation-defined valid time" etc., are
likely to be confusing at best.

<snip>

Aug 7 '08 #5
santosh <sa*********@gmail.comwrites:
CBFalconer wrote:
>Ian Collins wrote:
>>ramu wrote:

Could you please let me know how to use _TIME_ macro with a
sample code?

#include <stdio.h>
int main(void) {
puts(__TIME__);
}

Reading the (easily available) standard is much faster. I.e:


The Standard isn't easily available at all from the perspective of a
beginner. Even the existence of a Standard, it's Committee's website,
and the presence of public drafts is unknown to the vast majority of
newbies. Besides, the Standard document (or the draft) is _not_ a good
place for a newbie to seek help. He would be much better off with
almost any decent C book or tutorial.
> 6.10.8 Predefined macro names

[#1] The following macro names shall be defined by the
implementation:

... snip ...

__TIME__ The time of translation of the source file: a
character string literal of the form "hh:mm:ss" as
in the time generated by the asctime function. If
the time of translation is not available, an
implementation-defined valid time shall be
supplied.

This would be most opaque to someone just starting out with C. Terms
like "implementation", "translation", "character string
literal", "asctime", "implementation-defined valid time" etc., are
likely to be confusing at best.

<snip>
very well said. There is hope for you yet.
Aug 7 '08 #6
santosh wrote:
CBFalconer wrote:
.... snip ...
>
>Reading the (easily available) standard is much faster. I.e:

The Standard isn't easily available at all from the perspective
of a beginner. Even the existence of a Standard, it's Committee's
website, and the presence of public drafts is unknown to the vast
majority of newbies. Besides, the Standard document (or the draft)
is _not_ a good place for a newbie to seek help. He would be much
better off with almost any decent C book or tutorial.
That's why I attached a list of places to get such things, which
you snipped. Most newbies accessing Usenet have access to the WWW
system.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Aug 7 '08 #7
CBFalconer wrote:
santosh wrote:
>CBFalconer wrote:
... snip ...
>>
>>Reading the (easily available) standard is much faster. I.e:

The Standard isn't easily available at all from the perspective
of a beginner. Even the existence of a Standard, it's Committee's
website, and the presence of public drafts is unknown to the vast
majority of newbies. Besides, the Standard document (or the draft)
is _not_ a good place for a newbie to seek help. He would be much
better off with almost any decent C book or tutorial.

That's why I attached a list of places to get such things, which
you snipped. Most newbies accessing Usenet have access to the WWW
system.
That still leaves unsolved the difficulty for a newbie of comprehending
the Standard's language. The C Standard is only accessible for someone
already fairly experienced with C (at least a year I would say), unless
the person were extraordinarily bright.

Aug 7 '08 #8
santosh wrote:
CBFalconer wrote:
>santosh wrote:
>>CBFalconer wrote:
... snip ...
>>>
Reading the (easily available) standard is much faster. I.e:

The Standard isn't easily available at all from the perspective
of a beginner. Even the existence of a Standard, it's Committee's
website, and the presence of public drafts is unknown to the vast
majority of newbies. Besides, the Standard document (or the draft)
is _not_ a good place for a newbie to seek help. He would be much
better off with almost any decent C book or tutorial.

That's why I attached a list of places to get such things, which
you snipped. Most newbies accessing Usenet have access to the WWW
system.

That still leaves unsolved the difficulty for a newbie of
comprehending the Standard's language. The C Standard is only
accessible for someone already fairly experienced with C (at least
a year I would say), unless the person were extraordinarily bright.
Well, we definitely disagree here. :-) Being fairly facile in
English is probably needed, though.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

Aug 7 '08 #9

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

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
40
by: Steve Juranich | last post by:
I know that this topic has the potential for blowing up in my face, but I can't help asking. I've been using Python since 1.5.1, so I'm not what you'd call a "n00b". I dutifully evangelize on the...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
8
by: ben | last post by:
hello, i'm trying to answer a "prove an upper bound on the number of machine instructions required to process M connections on N objects" exercise from an algorithms book. i don't understand a...
22
by: José Teixeira Junior | last post by:
Hi, How i can add one new unknown control at runtime in my form1? Thaks.
2
by: Ryan Adler | last post by:
I have a terrible headache from this problem. Perhaps someone can help. My XML is formatted like this: <events> <event> <starts-at>123456<starts-at/> <event> ... <events/>
5
by: Alex | last post by:
hi there, in my program (made with Visual C++) is one subroutine that slows down the entire programm quite a bit. I would like to know, which part of this subroutine is causing this and why. Does...
45
by: Master Programmer | last post by:
- Constant language / system changes - Dropping of the VB language - Security configuation minefields - Loss of old code base - Time consuming to learn (then it changes every 5 minutes) - Slow...
4
by: Mike Copeland | last post by:
How do I mask out all but the _time_ components of a time_t value? Specifically, I have the following: time_t wTime = 1226764757; I happen to know that this is November 16, 2008 @ 8:59:17, but I...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.