Skip to contentSkip to conversation

how to calculate the system idle time

DISCUSSION snoopyzwe 4 participants 6 messages Jul 21, 2003

lore
Share & tools
lore

snoopyzwe

author
#0 lore raw

I want to implement a module, whose main task is to check the system idle time(no keyboard and mouse input) and suspend the whole system(when the idle time is long enough). But there comes the problem, how to calculate the system idle time. How can I get the time user has no operation.
thanks
snoopyzwe

#1 lore raw
Quoted 8 lines · snoopyzwe

I want to implement a module, whose main task is to check the system idle time(no keyboard and mouse input) and suspend the whole system(when the idle time is long enough). But there comes the problem, how to calculate the system idle time. How can I get the time user has no operation.
thanks
snoopyzwe

The the source-code of top and review it. Make a user-mode daemon to watch the system...

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.

author
#2 lore raw

thanks for you advice
one foolish question
what "top" means?
could you tell me more about how to watch the system? thank you very much
I am a newbie

Quoted 29 lines · snoopyzwe
Quoted 13 lines

I want to implement a module, whose main task is to check the system idle time(no keyboard and mouse input) and suspend the whole system(when the idle time is long enough). But there comes the problem, how to calculate the system idle time. How can I get the time user has no operation.
thanks
snoopyzwe

The the source-code of top and review it. Make a user-mode daemon to watch the system...

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.

#3 lore raw

"top" is an utility that cames with the Procps package.

Lucas

Quoted 30 lines · snoopyzwe

thanks for you advice
one foolish question
what "top" means?
could you tell me more about how to watch the system? thank you very much
I am a newbie

Quoted 9 lines · snoopyzwe
Quoted 7 lines

I want to implement a module, whose main task is to check the system idle time(no keyboard and mouse input) and suspend the whole system(when the idle time is long enough). But there comes the problem, how to calculate the system idle time. How can I get the time user has no operation.
thanks
snoopyzwe

Quoted 8 lines

The the source-code of top and review it. Make a user-mode daemon to watch the system...

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 1 line · [email protected] (Lucas Correia Villa Real) writes:

"top" is an utility that cames with the Procps package.

But that's probably not what he needs anyway: by idle time he meant "no keyboard and mouse input". He should take a look at /proc/interrupts IMHO.

Signature · 4 lines
Mathieu Chouquet-Stringer              E-Mail : [email protected]
       Never attribute to malice that which can be adequately
                    explained by stupidity.
                     -- Hanlon's Razor --
#5 lore raw
Quoted 5 lines · Mathieu Chouquet-Stringer
Quoted 1 line · [email protected] (Lucas Correia Villa Real) writes:

"top" is an utility that cames with the Procps package.

But that's probably not what he needs anyway: by idle time he meant "no keyboard and mouse input". He should take a look at /proc/interrupts IMHO.

Ah, sure! He can give a look on Documentation/filesystems/proc.txt for more information about it.

Lucas