Sponsored Content
Top Forums Programming How to get uptime in miliseconds ? Post 302579315 by Pufo on Monday 5th of December 2011 12:05:45 PM
Old 12-05-2011
Which do you think is faster:

jim mcnamara version, or mine ?

Code:
unsigned long ms_uptime()
{
   std::string script_loc, line;
   script_loc = "/proc/uptime";
   m_file.open(script_loc.c_str());

   if(m_file){

       getline(m_file, line);
       double param = atof(line.c_str());
       m_file.close();
 
       return param*1000;  
   } 
   return -1;
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

uptime

Hi Folks uptime 12:24pm up 2 days, 3:12, 4 users, load average: 0.00, 0.00, 0.00 what does the load average figure mean.. regards Hrishy (2 Replies)
Discussion started by: xiamin
2 Replies

2. UNIX for Dummies Questions & Answers

Getting uptime

I'm trying to get the uptime of my computer (Mac OS X) and I can go into the terminal and type "uptime" OK, and that gives me a string with the uptime in it. The problem is that the string changes a lot, and its very difficult to get the data I'm trying to extract out cleanly. Now I have 3... (2 Replies)
Discussion started by: Freefall
2 Replies

3. UNIX for Dummies Questions & Answers

uptime

On HP-UX, the 13th argument of uptime is sometime the load and sometime the word AVERAGE:??? 14 Jun 06 5:00pm up 44 days, 54 mins, 0 users, load average: 0.00, 0.02, 0.03 14 Jun 06 5:15pm up 44 days, 1:09, 0 users, load average: 0.00, 0.01, 0.01 When the time is in minutes, then the load... (1 Reply)
Discussion started by: qfwfq
1 Replies

4. UNIX for Dummies Questions & Answers

Uptime

hello folks! how can I display just the uptime without the current time, the word "up", and the load averages using the uptime command or some other command I do not know about? (13 Replies)
Discussion started by: MastaFue
13 Replies

5. Solaris

having problem with uptime.

HI All, I have problem with "uptime" on one of the sun server.(SunOS 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-V240).when i am issuing uptime command its not showing uptime.even its not showing output for who -b. $ uptime 11:01am 1 user, load average: 0.06, 0.04, 0.03 $ who -b $... (3 Replies)
Discussion started by: jeevanbv
3 Replies

6. AIX

Hmc uptime

HELLO ALL HOW CAN I CHECK HMC UPTIME :confused: :confused: VERSION 6 :D (7 Replies)
Discussion started by: kalaso
7 Replies

7. Shell Programming and Scripting

Process Uptime

Hi, I need some help about a script i need to write. I want to check , if some specific process, are running since 2 hours. I tried to use a loop , grep my pid and use find -ctime on /proc directory, to list what i need. for i in `ps -ef |grep process |grep -v grep|awk '{print $2}'`... (2 Replies)
Discussion started by: rokerij
2 Replies

8. Linux

uptime options

Hi All is there a way that i can return uptime if the machine has been on for longer than 4 days thanks ab (3 Replies)
Discussion started by: ab52
3 Replies

9. Shell Programming and Scripting

Extract the uptime from the output of the uptime command

Hi! I want to extract the uptime from the output of the uptime command. The output: 11:53 up 3:02, 2 users, load averages: 0,32 0,34 0,43 I just need the "3:02" part. How can I do this? Dirk (6 Replies)
Discussion started by: Dirk Einecke
6 Replies

10. War Stories

Once upon an uptime.

Hi All, Having recently started a new job, a Data Center Migration in fact I have been tasked with looking at some of the older Solaris boxes when I came across this little gem. nismas# uname -a SunOS nismas 5.5.1 Generic_103640-27 sun4u sparc SUNW,Ultra-1 nismas# uptime 10:37am up 2900... (2 Replies)
Discussion started by: gull04
2 Replies
std::extreme_value_distribution< _RealType >(3) 	     Library Functions Manual		   std::extreme_value_distribution< _RealType >(3)

NAME
std::extreme_value_distribution< _RealType > - SYNOPSIS
Classes struct param_type Public Types typedef _RealType result_type Public Member Functions extreme_value_distribution (_RealType __a=_RealType(0), _RealType __b=_RealType(1)) extreme_value_distribution (const param_type &__p) template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng) template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p) template<typename _UniformRandomNumberGenerator > void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p) _RealType a () const _RealType b () const result_type max () const result_type min () const template<typename _UniformRandomNumberGenerator > extreme_value_distribution < _RealType >::result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)" template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng) template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p) param_type param () const void param (const param_type &__param) void reset () Friends bool operator== (const extreme_value_distribution &__d1, const extreme_value_distribution &__d2) Detailed Description template<typename _RealType = double>class std::extreme_value_distribution< _RealType > A extreme_value_distribution random number distribution. The formula for the normal probability mass function is p(x|a,b) = ac{1}{b} xp( ac{a-x}{b} - xp(ac{a-x}{b})) ] Definition at line 5051 of file random.h. Member Typedef Documentation template<typename _RealType = double> typedef _RealType std::extreme_value_distribution< _RealType >::result_type The type of the range of the distribution. Definition at line 5054 of file random.h. Member Function Documentation template<typename _RealType = double> _RealType std::extreme_value_distribution< _RealType >::a () const [inline] Return the $a$ parameter of the distribution. Definition at line 5109 of file random.h. template<typename _RealType = double> _RealType std::extreme_value_distribution< _RealType >::b () const [inline] Return the $b$ parameter of the distribution. Definition at line 5116 of file random.h. template<typename _RealType = double> result_type std::extreme_value_distribution< _RealType >::max () const [inline] Returns the least upper bound value of the distribution. Definition at line 5145 of file random.h. References std::numeric_limits< _Tp >::max(). template<typename _RealType = double> result_type std::extreme_value_distribution< _RealType >::min () const [inline] Returns the greatest lower bound value of the distribution. Definition at line 5138 of file random.h. References std::numeric_limits< _Tp >::lowest(). template<typename _RealType = double> template<typename _UniformRandomNumberGenerator > result_type std::extreme_value_distribution< _RealType >::operator() (_UniformRandomNumberGenerator &__urng) [inline] Generating functions. Definition at line 5153 of file random.h. template<typename _RealType = double> param_type std::extreme_value_distribution< _RealType >::param () const [inline] Returns the parameter set of the distribution. Definition at line 5123 of file random.h. Referenced by std::operator>>(). template<typename _RealType = double> void std::extreme_value_distribution< _RealType >::param (const param_type &__param) [inline] Sets the parameter set of the distribution. Parameters: __param The new parameter set of the distribution. Definition at line 5131 of file random.h. template<typename _RealType = double> void std::extreme_value_distribution< _RealType >::reset () [inline] Resets the distribution state. Definition at line 5102 of file random.h. Friends And Related Function Documentation template<typename _RealType = double> bool operator== (const extreme_value_distribution< _RealType > &__d1, const extreme_value_distribution< _RealType > &__d2) [friend] Return true if two extreme value distributions have the same parameters. Definition at line 5188 of file random.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::extreme_value_distribution< _RealType >(3)
All times are GMT -4. The time now is 11:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy