Created
April 30, 2013 16:33
-
-
Save misodengaku/5489908 to your computer and use it in GitHub Desktop.
uptime(キモい)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uptime.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 | |
// | |
#include "stdafx.h" | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
unsigned long long time = GetTickCount64(), day, hour, min, sec; | |
day = time / 86400000i64; | |
time = time % 86400000i64; | |
hour = time / 3600000i64; | |
time = time % 3600000i64; | |
min = time / 60000i64; | |
time = time % 60000i64; | |
sec = time / 1000i64; | |
time = time % 1000i64; | |
printf("システムが起動してからの経過時間\n"); | |
printf("%lld日 %lld時間%lld分%lld秒", day, hour, min, sec); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment