You are not logged in.
I just want a daemon that records how long a program is running.. just wanna see how much time I spend gaming, browsing, listening to music, etc.
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
you might be interested in the 'time' command. Here's a totally useless but demonstrative example:
$ time for i in `seq 1 100000`; do echo $i > /dev/null; done
real 0m6.434s
user 0m4.231s
sys 0m1.369s
Offline
That's cpu usage, not the length of a program existing in memory
But thanks anyway
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
That's cpu usage, not the length of a program existing in memory
But thanks anyway
no, it does exactly what you want to do. see 'real' ?
[root@sara iphitus]# time sleep 5
real 0m5.002s
user 0m0.001s
sys 0m0.000s
Offline
hmm is it possible to somehow integrate it and make it automatically run when a certain command is launched (i dont want to monitor everything.. lol) and then save the date before time is launched and after... for the record.. in fact a simple "BEF=`date`; app; AFT=`date`; TIM=$AFT-$BEF; echo $TIM > time.app" could work.. of course u need to modify it to diplay only time and with only numbers (ex. 1802-1200 =602.. so it ran for 6 hours and 2 min ) this is also dirty and if anyone could come up with a sufficiently clean and resource-friendly daemon to do this, i would appreciate it
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
working on a perl script right now.. (my first one lol)
i have an idea of how i can actually pull this off
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
Ok well i wrote a script (actually 4 lol) totalling to 3kb of script code (a lot for me..)
The script itself only needs 1-3mb of RAM and 0% CPU when the program is running..
It records how long the program has been on for into a file (individual per program) when the program closes, when it is started again, a new entry is added to the same file and at the end of it..a "Total:" line is added showing the total amount of time it has ever been running
It is a pretty good script and I COULD just add aliases to .bashrc but this isnt perfect and you have to wait until the program is closed to view how long it ran for.. also if anything besides bash runs it.. it wont work (for example opening mp3s or docs from nautilis or launching firefox from other apps, etc.
Well it took me about 3-4 hours to write this, and it's my first actually useful script so im glad i did it..
I hope someone can write a real daemon in C++ or other language that is better and more functional Please..
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
Care to share it in the User Contributions forum?
I am sure that at least one more person will find this useful, and you can end up with fixes and encasements from other people for free.
Offline
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
I just looked in gnome-system-monitor and it shows when the program was started so i guess there is a daemon that knows when it was started... now i just need to know how to make it work like "uptime" except "up <program>" and make a db like "uprecords" for multiple apps.. anyone wanna do this? lol
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline
Process info is stored in /proc... I believe that's where ps gets the information.
And where were all the sportsmen who always pulled you though?
They're all resting down in Cornwall
writing up their memoirs for a paper-back edition
of the Boy Scout Manual.
Offline
ya thats right but if i use ps or any other program every 2 sec.. its gonna lag
my dad wants me to write a kernel module oO wtf.. i dont even know c
Darkstar:
Athlon 64 3500+ (OC ~2.49ghz)
Leadtek GeForce 6800 128mb (unlocked/OC)
Rosewill Value DDR400 1GB
WDC SE 80GB
NEC 3550 DVDRW DL 16X
Offline