UpTime of an application
-
What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. For this purpose i need to record the time when application starts and then subtract the current time from initial time to get the difference. I want this difference in the format "dd:hh:min:sec", how can i do so ?
-
What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. For this purpose i need to record the time when application starts and then subtract the current time from initial time to get the difference. I want this difference in the format "dd:hh:min:sec", how can i do so ?
-
What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. For this purpose i need to record the time when application starts and then subtract the current time from initial time to get the difference. I want this difference in the format "dd:hh:min:sec", how can i do so ?
just an idea ..not sure whether right or wrong...what about gettickcount()
-
just an idea ..not sure whether right or wrong...what about gettickcount()
tarundeep singh wrote: what about gettickcount() :) It would work, but measuring uptime in milliseconds is probably overkill. Using
GetSystemTime()
will be more than adequate. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
just an idea ..not sure whether right or wrong...what about gettickcount()
tarundeep singh wrote: gettickcount() No, i can't use GetTickCount(), because its return value is of 4 bytes, and suppose my computer is up continuously for 2 months then these 4 bytes are not enough to get time difference.
-
What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. For this purpose i need to record the time when application starts and then subtract the current time from initial time to get the difference. I want this difference in the format "dd:hh:min:sec", how can i do so ?
John-theKing wrote: What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. Are you wanting to know how long an application has been running, or how long the OS has been running?
-
What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. For this purpose i need to record the time when application starts and then subtract the current time from initial time to get the difference. I want this difference in the format "dd:hh:min:sec", how can i do so ?
Use CTime and CTimeSpan John
-
John-theKing wrote: What is the effective way to find the uptime of an application? I have a server application and i want to ask the server its uptime. Are you wanting to know how long an application has been running, or how long the OS has been running?
DavidCrow wrote: Are you wanting to know how long an application has been running, or how long the OS has been running? I want to know that how long my application is running ?
-
DavidCrow wrote: Are you wanting to know how long an application has been running, or how long the OS has been running? I want to know that how long my application is running ?
See if GetProcessTimes() helps.