LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 05-22-2005, 07:03 AM   #1
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
an open source program that only gives the user a certain amount of time to input?


hi. im trying to design a gui program that will quiz her on math. When she takes the quizzes at school they are timed so i want to include this element into the program. Im not certain how to set up the timer aspect of the program. I've been looking at C/C++ libraries dealing with time to try to get a better idea but haven't had much luck yet. Is there an open source program that anyone knows of that has part of the program end after a timer is up that i could look at the source code to get ideas? any help would be appreciated. thanks in advanced.
 
Old 05-22-2005, 08:36 AM   #2
Cyborg16
LQ Newbie
 
Registered: Feb 2005
Distribution: Debian "Sarge" testing
Posts: 19

Rep: Reputation: 0
SDL has timer functionality included, which you can use.
 
Old 05-22-2005, 09:40 AM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-22-2005, 01:51 PM   #4
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Don't know how this relates to your GUI code but in C, alarm(2) can be used to interrupt a process and force a read(2) to return EINTR after a specified time. man 2 alarm for details. You'll also have to setup an empty signal handler.
 
Old 05-22-2005, 10:56 PM   #5
Dave Kelly
Member
 
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 215

Rep: Reputation: 31
seconds = read clock ()
while count down = read clock() != seconds + time out
accept keyboard input()
break;
 
  


Reply



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
Make most amount of Linux users in least amount of time studpenguin General 24 02-02-2007 03:42 PM
Control amount of time a user may be logged in. (Parental Control) darrensnospam Mandriva 13 02-18-2006 05:01 PM
c program that executes during a certain amount of time jagman Programming 6 04-13-2005 09:22 AM
Open source: Time to pay up Ephracis Linux - News 4 02-15-2005 09:28 PM
looking for an open source program that can... Eugene Programming 6 11-13-2003 02:53 AM

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

All times are GMT -5. The time now is 12:29 PM.

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