public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* RE: timer
@  Dawes, Stephen
   ` timer Laura Eaves
   ` timer Cheryl Homiak
  0 siblings, 2 replies; 6+ messages in thread
From: Dawes, Stephen @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Why not write a little script that does what you want.

Basically all you are wanting is available in linux already. A little
scripting, and you got what you want.

The simple one for a timer to run for a period of time is simply
something like

#!/bin/bash
for T <= %1 ; do
Sleep 1;
Echo $T
Done
Play alarm

NOTE: I have used pseudo code in my example, but you get the idea I
hope. The %1 is a value that you pass to the script when you call it. 
For example, if you want to time something for 60 seconds you put in 60
when you call the script. The sleep 1 command tells linux to sleep for 1
second before executing the next command. The play alarm at the end of
my example is a generic statement that I used to show you that when the
loop is done you can tell the script what to do next.

Steve Dawes
Phone: (403) 268-5527
Email: SDawes@calgary.ca
 
 


NOTICE -
This communication is intended ONLY for the use of the person or entity named above and may contain information that is confidential or legally privileged. If you are not the intended recipient named above or a person responsible for delivering messages or communications to the intended recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying of this communication or any of the information contained in it is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and then destroy or delete this communication, or return it to us by mail if requested by us. The City of Calgary thanks you for your attention and cooperation.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: timer
   timer Dawes, Stephen
@  ` Laura Eaves
     ` timer Lorenzo Prince
   ` timer Cheryl Homiak
  1 sibling, 1 reply; 6+ messages in thread
From: Laura Eaves @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

why not just say

sleep "$1"

instead of using a for loop? Much more efficient.
Take care.
--le

----- Original Message ----- 
From: "Dawes, Stephen" <Stephen.Dawes@calgary.ca>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Thursday, January 20, 2005 2:10 PM
Subject: RE: timer


Why not write a little script that does what you want.

Basically all you are wanting is available in linux already. A little
scripting, and you got what you want.

The simple one for a timer to run for a period of time is simply
something like

#!/bin/bash
for T <= %1 ; do
Sleep 1;
Echo $T
Done
Play alarm

NOTE: I have used pseudo code in my example, but you get the idea I
hope. The %1 is a value that you pass to the script when you call it.
For example, if you want to time something for 60 seconds you put in 60
when you call the script. The sleep 1 command tells linux to sleep for 1
second before executing the next command. The play alarm at the end of
my example is a generic statement that I used to show you that when the
loop is done you can tell the script what to do next.

Steve Dawes
Phone: (403) 268-5527
Email: SDawes@calgary.ca




NOTICE -
This communication is intended ONLY for the use of the person or entity 
named above and may contain information that is confidential or legally 
privileged. If you are not the intended recipient named above or a person 
responsible for delivering messages or communications to the intended 
recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying of 
this communication or any of the information contained in it is strictly 
prohibited. If you have received this communication in error, please notify 
us immediately by telephone and then destroy or delete this communication, 
or return it to us by mail if requested by us. The City of Calgary thanks 
you for your attention and cooperation.


_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: timer
   timer Dawes, Stephen
   ` timer Laura Eaves
@  ` Cheryl Homiak
     ` timer Laura Eaves
  1 sibling, 1 reply; 6+ messages in thread
From: Cheryl Homiak @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

The problem with just using sleep is that I want a continuous display of 
the time going by, not just an alarm at the end of the time.
But yes, when I get it figured out, I will write a script.
Thanks.


-- 
Cheryl

"Where your treasure is, there will your heart be also."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: timer
   ` timer Cheryl Homiak
@    ` Laura Eaves
  0 siblings, 0 replies; 6+ messages in thread
From: Laura Eaves @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Hi Cheryl --
Have you considered writing a little C program to use the SIGALRM signal to 
periodically display the time?
This isn't hard and could display the time in smaller increments if you 
want.  (Actually I'm not sure.)
But you would need to choose how you want to display the info -- perhaps 
just using printf?
The program would be quite small and faster than invoking commands from the 
shell. It all would be done in one process.
Anyway, just a thought.
Have fun.
--le


----- Original Message ----- 
From: "Cheryl Homiak" <chomiak@charter.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Friday, January 21, 2005 10:34 AM
Subject: RE: timer


The problem with just using sleep is that I want a continuous display of
the time going by, not just an alarm at the end of the time.
But yes, when I get it figured out, I will write a script.
Thanks.


-- 
Cheryl

"Where your treasure is, there will your heart be also."


_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: timer
   ` timer Laura Eaves
@    ` Lorenzo Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Prince @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Thus spake Laura Eaves:
# why not just say
# 
# sleep "$1"
# 
# instead of using a for loop? Much more efficient.

That works, but it won't show the time as it counts down.  Although it will allow
you to set whether you want to count in seconds, minutes, hours or days.

PRINCE


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: timer
@  Dawes, Stephen
  0 siblings, 0 replies; 6+ messages in thread
From: Dawes, Stephen @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

That would work also, but then the script would not show the elapse
time. By using a for loop, you can display a count of each second, and I
thought that was part of the original question.

Steve Dawes
Phone: (403) 268-5527
Email: SDawes@calgary.ca
 
 


NOTICE -
This communication is intended ONLY for the use of the person or entity named above and may contain information that is confidential or legally privileged. If you are not the intended recipient named above or a person responsible for delivering messages or communications to the intended recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying of this communication or any of the information contained in it is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and then destroy or delete this communication, or return it to us by mail if requested by us. The City of Calgary thanks you for your attention and cooperation.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 timer Dawes, Stephen
 ` timer Laura Eaves
   ` timer Lorenzo Prince
 ` timer Cheryl Homiak
   ` timer Laura Eaves
 timer Dawes, Stephen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).