博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C语言显示系统时间的几个办法
阅读量:3532 次
发布时间:2019-05-20

本文共 742 字,大约阅读时间需要 2 分钟。

C语言显示系统时间的几个办法#include 
#include
#include
int main(){ time_t t = time(0); char tmp[64]; strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A 本月第%j天 %z",localtime(&t) ); puts( tmp ); return 0; }#include
#include
int main () { time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); printf ( "The current date/time is: %s", asctime (timeinfo) ); } #include
#include
#include
using namespace std;int main(){ time_t t; while(1) { time(&t); cout << ctime(&t) << endl; cout << asctime(localtime(&t)) << endl; Sleep(900); system("cls");//借助CLS实现动态更新时间 }}

DWORD end_time = GetTickCount();

DWORD start_time = GetTickCount();

转载地址:http://zoyhj.baihongyu.com/

你可能感兴趣的文章
POJ 1915 Knight Moves
查看>>
Git 撤销修改
查看>>
Git 删除文件
查看>>
Git与远程仓库关联以及关联错误解决方法
查看>>
[HDU] 平方和与立方和
查看>>
[HDU 2096] 小明A+B
查看>>
[HDU 2520] 我是菜鸟,我怕谁(不一样的for循环)
查看>>
[HDU 1215] 七夕节(求因子,不超时)
查看>>
[POJ 1915] Knight Moves
查看>>
Memcache技术精华
查看>>
Redis详解入门篇
查看>>
php开启redis扩展包与redis安装
查看>>
php使用openssl来实现非对称加密
查看>>
pdo如何防止 sql注入
查看>>
myisam和innodb的区别
查看>>
MySQL建表规范与注意事项(个人精华)
查看>>
JDK8接口的新特性
查看>>
synchronized的局限性与lock的好处
查看>>
redis和memcached有什么区别?
查看>>
Spring中的设计模式
查看>>