LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to turn off background process and get the time difference by using c/c++ coding (https://www.linuxquestions.org/questions/programming-9/how-to-turn-off-background-process-and-get-the-time-difference-by-using-c-c-coding-4175412511/)

DWAYN3 06-20-2012 12:19 PM

How to turn off background process and get the time difference by using c/c++ coding
 
i facing some critical coding problem.i'm try to design a system that able to calculate the time after finished typing a password and the time between each single word of the password.
For example, 12345 is my password, i wish to calculate the time taken to finish the password and the time taken between 1st word(1) and the 2nd word(2).
I have to turn off all the background process so that able to extract the accurate time.

any one know how to solve this problem ?:(

pan64 06-20-2012 12:26 PM

duplicate of http://www.linuxquestions.org/questi...ng-4175412510/

pan64 06-20-2012 12:29 PM

what kind of os you have? how will your box work if you turn off all your background processes? (nohow, it will not work any more)










__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.

Nominal Animal 06-20-2012 04:57 PM

You're approaching the entire problem completely wrong.

If you wish to monitor local keyboards, you use the Linux input event subsystem to read keyboard events and submit them back via uinput. See pyinputevent for example. Using clock_gettime(CLOCK_REALTIME,&timespec) in C, or datetime.utcnow() in Python, to measure the key down and key up events will give you very high precision timestamps you can use. The daemon will of course have to be run with elevated privileges (as root), since normal users do not have the rights needed to access the input devices.

However, the entire idea of monitoring users' keyboards stinks to high heaven for me. Why would you want to do that?

DWAYN3 07-25-2012 01:37 PM

is my final year project..use c+ or c++ to create a system that can investigate use of timing patterns of keystrokes based on a numerical keypad of recognize individual user.i have no idea how to do it

NevemTeve 07-25-2012 01:56 PM

In non-canonical mode keypresses will be returned by read(2) individually (use gettimeofday to get the timestamp).
See termios' manual for details. (Example: shkeys.c)


All times are GMT -5. The time now is 12:20 AM.