C/C++ʱ¼äº¯ÊýµÄʹÓÃ
Ò»¡¢»ñÈ¡ÈÕÀúʱ¼ä
time_tÊǶ¨ÒåÔÚtime.hÖеÄÒ»¸öÀàÐÍ£¬±íʾһ¸öÈÕÀúʱ¼ä£¬Ò²¾ÍÊÇ´Ó1970Äê1ÔÂ1ÈÕ0ʱ0·Ö0Ãëµ½´ËʱµÄÃëÊý£¬ÔÐÍÊÇ£º
typedef long time_t; /* time value */
¿ÉÒÔ¿´³ötime_tÆäʵÊÇÒ»¸ö³¤ÕûÐÍ£¬ÓÉÓÚ³¤ÕûÐÍÄܱíʾµÄÊýÖµÓÐÏÞ£¬Òò´ËËüÄܱíʾµÄ×î³Ùʱ¼äÊÇ2038Äê1ÔÂ18ÈÕ19ʱ14·Ö07Ãë¡£
º¯Êýtime¿ÉÒÔ»ñÈ¡µ±Ç°ÈÕÀúʱ¼äʱ¼ä£¬timeµÄ¶¨Ò壺
time_t time(time_t *)
#include <iostream>
#include <time.h>
using namespace std;
int main(void)
{
time_t nowtime;
nowtime = time(NULL); //»ñÈ¡µ±Ç°Ê±¼ä
cout << nowtime << endl;
return 0;
}
Êä³ö½á¹û:1268575163
¶þ¡¢»ñÈ¡±¾µØʱ¼ä
time_tÖ»ÊÇÒ»¸ö³¤ÕûÐÍ£¬²»·ûºÏÎÒÃǵÄʹÓÃÏ°¹ß£¬ÐèҪת»»³É±¾µØʱ¼ä£¬¾ÍÒªÓõ½tm½á¹¹£¬time.hÖнṹtmµÄÔÐÍÊÇ£º
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
};
¿ÉÒÔ¿´³ö£¬Õâ¸ö»ú¹¹¶¨ÒåÁËÄê¡¢Ô¡¢ÈÕ¡¢Ê±¡¢·Ö¡¢Ãë¡¢ÐÇÆÚ¡¢µ±ÄêÖеÄijһÌì¡¢ÏÄÁîʱ¡£¿ÉÒÔÓÃÕâ¸ö½á¹¹ºÜ·½±ãµÄÏÔʾʱ¼ä¡£
ÓÃlocaltime»ñÈ¡µ±Ç°ÏµÍ³Ê±¼ä£¬¸Ãº¯Êý½«Ò»¸ötime_tʱ¼äת»»³Étm½á¹¹±íʾµÄʱ¼ä
Ïà¹ØÎĵµ£º
http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......
ת×Ô£ºhttp://www.bmrtech.com/article/2008/081126.htm
ûÈËÄÜ·ñÈÏǶÈëʽӦÓÃÕý±äµÃÔ½À´Ô½Æձ顣µ«ÊÇ£¬µ±ÏµÍ³Ô½À´Ô½¸´ÔÓ£¬¶øÎÒÃǸ³ÓèϵͳԽÀ´Ô½¶àµÄÔðÈεÄʱºò£¬ÎÒÃǽ«±ØÐëÃæ¶ÔһЩÖØÒªÎÊÌâ¡£ÆäÖÐ×îÖØÒªµÄÎÊÌâÊÇ£ºÎÒÃÇÈçºÎ²ÅÄÜÈ·±£Ç¶ÈëʽϵͳÊÇ°²È«¿É¿¿µÄ£¿
C ±à³ÌÓïÑÔΪÓû§ÌṩÁËÐí¶àÇ¿´óµÄ¹¦ÄÜ£¬¼ ......
JAVAºÍC++¶¼ÊÇÃæÏò¶ÔÏóÓïÑÔ¡£Ò²¾ÍÊÇ˵£¬ËüÃǶ¼Äܹ»ÊµÏÖÃæÏò¶ÔÏó˼Ï루·â×°£¬¼Ì³Ë£¬¶à̬£©¡£¶øÓÉÓÚc++ΪÁËÕչ˴óÁ¿µÄCÓïÑÔʹÓÃÕߣ¬¶ø¼æÈÝÁËC£¬Ê¹µÃ×ÔÉí½ö½ö³ÉΪÁË´øÀàµÄCÓïÑÔ£¬¶à¶àÉÙÉÙÓ°ÏìÁËÆäÃæÏò¶ÔÏóµÄ³¹µ×ÐÔ£¡JAVAÔòÊÇÍêÈ«µÄÃæÏò¶ÔÏóÓïÑÔ£¬Ëü¾ä·¨¸üÇåÎú£¬¹æÄ£¸üС£¬¸üÒ×ѧ¡£ËüÊÇÔÚ¶Ô¶àÖÖ³ÌÐòÉè¼ÆÓïÑÔ½øÐÐÁËÉîÈëϸÖÂÑо¿µ ......
ÕâÁ½ÌìѧϰC++ѧÀÛÁË£¬¿´Á˺ܶàµÄÍøÕ¾ÂÛ̳£¬Í»È»¸Ð¾õÃÔãÁË£¬c/c++µ½µ×ÄÜ×öʲôÄØ£¿ÏÖÔÚJAVAºÜÈÈ£¬Ò²ºÜºÃÕÒ¹¤×÷£¬¶øÇÒѧÆðÀ´»¹Ìý˵ºÜÈÝÒ×ÈëÃÅ¡£²»ÓÃѧ¼ÆËã»ú»ù´¡ÀàµÄ֪ʶ£¬¿ÉC/C++¾Í²»Í¬ÁË£¬Ö»Ñ§±à³Ì»¹²»ÐУ¬»¹µÃѧʲôÊý¾Ý½á¹¹£¬Ëã·¨£¬¼ÆËã»úÔÀí£¬²Ù×÷ϵͳ£¬»ã±àÓïÑÔ£¬±à³ÌÓþߵȵȣ¬ÐèÒªºÃ¶à£¬¸Ð¾õÒ» ......