LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2012, 12:19 PM   #1
DWAYN3
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
Unhappy 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 ?
 
Old 06-20-2012, 12:26 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
duplicate of http://www.linuxquestions.org/questi...ng-4175412510/
 
Old 06-20-2012, 12:29 PM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
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.
 
Old 06-20-2012, 04:57 PM   #4
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
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?

Last edited by Nominal Animal; 06-20-2012 at 04:58 PM.
 
Old 07-25-2012, 01:37 PM   #5
DWAYN3
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 07-25-2012, 01:56 PM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to turn off background process and get the time difference by using c/c++ coding? DWAYN3 Linux - Newbie 1 06-20-2012 12:26 PM
difference between init.rc process and normal process manohar Programming 1 03-31-2011 11:17 PM
How to find the process ID of process executing in the background akeneche Linux - Newbie 1 01-03-2008 10:08 AM
turn off background disk writes ? dansawyer Linux - Software 5 02-12-2007 02:14 PM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 12:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration