Timer application in linux

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Timer application in linux
# 1  
Old 12-29-2011
Question Timer application in linux

Hello everyone,
It is good to be here.
I am a newbie to Linux.Can anyone help me in designing a timer application.
The timer has to start.And after certain time interval the program should call a function continuously.It should not be in sleep mode.During the course of that time interval the program should execute the rest of the functions or statements.

Plz help me in doing so...thanx in advanceSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

creating an application with gui in linux

hi, so I am familiar with visual studio for windows, I was wondering if there's that kind of IDE for linux that I can use to make an application... thanks! (2 Replies)
Discussion started by: h0ujun
2 Replies

2. Shell Programming and Scripting

Linux newbie scripting help needed (timer)

Hi, Newbie to Linux needing some help with scripting, here. I've written a script that allows easily shutting down, rebooting, or exiting to terminal mode via a Dialog menu after logging out of X-server. In my .bash_profile I have startx followed by running my script, shutdownmenu.sh, and it... (1 Reply)
Discussion started by: Pop45398
1 Replies

3. UNIX and Linux Applications

Linux application upgrade ways

Hello. I need upgrade memcached. This software is installed throuth yum. In official repositories isn`t newest version of memcached, but this one is vulnerable. So looks like I need built it from source, but I dont really want to install c libraries un compilers on system. 1.) So can I compile... (0 Replies)
Discussion started by: jabalv
0 Replies

4. Programming

Application Cleanup during Linux Shutdown

I'm trying to do some cleanup (write open files) when Linux shuts down. I thought the right method would be to trap SIGTERM and do the necessary processing. Here's my sample code: #include <stdio.h> // for File I/O #include <signal.h> // for signals #include <unistd.h> // for sleep() void... (6 Replies)
Discussion started by: whatisron
6 Replies

5. Advertise with Us

Wanted- Linux Application Engineers

Optiver US LLC is a worldwide market maker and derivatives trading firm with offices in Chicago, Amsterdam and Sydney. Attracting very ambitious, talented and results-oriented individuals to become members of a highly selective trading application engineering team. This position is a primary... (0 Replies)
Discussion started by: Barb S.
0 Replies

6. AIX

Migrating C Application from AIX to Linux

Hi All, I am currently facing new problem of migrating C(c language) application from AIX machine to Linux machine. We are using GCC to compile the source code.. But facing with the compilation issues, with lot of GCC C libs differing between AIX box to Linux box... Pls help me... (3 Replies)
Discussion started by: karthikc
3 Replies

7. Linux

Socket communication and timer application

tcp communication application i have an application which run in 1) while() {in } and listens for some request When a request comes to create a file(containing some data fetch from somewhere) but i also want to start some timer that after 10/20 min delete that file But i don't know how... (0 Replies)
Discussion started by: tryit
0 Replies

8. UNIX for Dummies Questions & Answers

socket communication and timer application

i need to develop application which continuously wait for a request from multiple host and on receiving a request on that need to create a log file and after 30 mins delete that file I am new to socket programming so could anyone help me on this. How to continuously listen for a request How... (0 Replies)
Discussion started by: tryit
0 Replies

9. SCO

SCO 5.0.6 application compatibility w/ Linux?

Hello Valued Members, I was wondering if there are any Linux, BSD, versions that can run SCO 5.0.6 applications without much modification? I was looking into purchasing a copy of Caldera Openlinux, the last version, but wanted to ask if there are any other options of a newer variant. I am also... (8 Replies)
Discussion started by: stay0ut
8 Replies

10. Programming

Porting Win32 application into Linux

I need port Win32 console application, which was developed with MS Visual Studio 6.0 (without MFC using) into Linux. What is the best way to port project? Are there any standard tools or decisions? Thank you in advance, Sergey (0 Replies)
Discussion started by: Sergeyy
0 Replies
Login or Register to Ask a Question
pods::SDL::Time(3pm)					User Contributed Perl Documentation				      pods::SDL::Time(3pm)

NAME
SDL::Time - An SDL Perl extension for managing timers CATEGORY
Core SYNOPSIS
use warnings; use strict; use threads; use threads::shared; use SDL::Time; package foo; use SDL ':all'; SDL::init(SDL_INIT_TIMER); my $tick :shared = 0; sub ticker { $tick++; warn $tick; return 100; } package main; my $id = SDL::Time::add_timer(100, 'foo::ticker'); sleep(2); SDL::Time::remove_timer($id); METHODS
add_timer my $id = SDL::Timer::add_timer( $ms_interval, $callback ); This runs in a separate thread and a cloned Perl thread. "threads" and "threads::shared" must be used to share any variables the timer uses. The $callback function, specified with a string of the function's name, will be called after the milliseconds of $interval have elapsed. The actual delay may be longer than specified depending on the underlying OS. The callback function is passed the current timer interval as well as the $interval parameter and should return the next timer interval. If the return value from the callback is 0, the timer is cancelled; otherwise, the timer will continue to run. The timer callback function may run in a different thread to your main program, so it shouldn't call any functions from within itself. You may call SDL::push_event, however. "SDL::Time::add_timer" returns the identifier value of the generated timer or undef on error. Note: You must initialize ("SDL::init") the timer subsystem to use this function. remove_timer SDL::Timer::remove_timer( $id ); The other way to cancel a timer is to use "SDL::Time::remove_timer" on the $id of a timer. This ID is the return value of the "SDL::Time::add_timer" function. "SDL::Time::remove_timer" returns 0 on success or "-1" on error. AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDL::Time(3pm)