bugGNU Octave - Bugs: bug #32316, Feature request: timer object...


bug #32316: Feature request: timer object functions

Submitter:  None
Submitted:  Tue 01 Feb 2011 04:11:09 PM UTC
Category:  Octave Function Severity:  1 - Wish
Priority:  1 - Later Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Rick T Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Fri 19 Apr 2024 06:57:55 AM UTC, comment #11: 

Hi all,

I just created a Timer object in the style of Matlab:

- https://gitlab.com/farhi/octave-timer

Hope this helps. You are free to incorporate officially in Octave  if you so wish.

Emmanuel FARHI <farhi>
Sat 20 Nov 2021 03:57:11 AM UTC, comment #10: 

yeah, that complexity is what i was indirectly hinting at. this isn't just computation, it's asynchronous processing and interpreter hooks. didn't know if there was anything existing for someone to start playing with that had callback fns like that would require.

Nicholas Jankowski <nrjank>
Group Member
Sat 20 Nov 2021 02:03:13 AM UTC, comment #9: 

The issue is not the user interface.  That can be coded up in m-files, classdef, or whatever.  The issue is that timers themselves are tricky objects and getting them to also work with the interpreter itself (what if Octave is doing something already when the timer fires?).

Certainly things have gotten easier since 2011 in that C++ or Qt offer building blocks that could make this possible.  But it will be a huge effort to gather everything together and fit them in to the current architecture of the interpreter.

Rik <rik5>
Group administrator
Wed 17 Nov 2021 10:34:32 PM UTC, comment #8: 

I know Octave classes have come a long way since this was first requested, but is still not complete. Are there any successfully implemented classes that make use of similar functionality to suggest Octave might have the ability to implement a timer class soon?

Nicholas Jankowski <nrjank>
Group Member
Mon 22 Jun 2020 01:49:21 AM UTC, comment #7: 

Hi all.
I received a ML R2006 code that uses this function/class but I can't make it work w/o this timer class.
I ask for a rise in the priority as its a class introduced several years ago and some important SW uses it.

Rafael <rtc>
Sun 24 Mar 2019 02:44:17 AM UTC, comment #6: 

updating that this is still missing in 5.1.0

also the link in Comment #2 is now broken.  I think the new link for reference is:


Nicholas Jankowski <nrjank>
Group Member
Sun 30 Sep 2018 10:38:11 PM UTC, comment #5: 

Updating that it is still missing in 4.4.1. If there is any hope for polling measurement instrumentation this request should be bumped up in its priority. Matlab is used extensively for coding virtual instruments. Without an asynchronous timer, time based measurements and control become considerably complicated.

Gilad Orr <gilo>
Thu 08 Dec 2016 03:48:37 AM UTC, comment #4: 

updating that this bug is still present in 4.2.0 (timer objects are not yet implemented)

Nicholas Jankowski <nrjank>
Group Member
Tue 29 Dec 2015 10:55:09 PM UTC, comment #3: 

Depending on what you want you may get the required functionality by input event hooks and some not so elegant work-arounds.
For example, I wanted to update a figure plot data periodically while releasing the prompt/terminal for user interaction (i.e. a while and usleep would not do).
Here is what I did:

% testimer.m:

function timer_Callback()
        persistent lastupdate = 0;
        newtime = time();
        if(newtime > lastupdate)
                lastupdate = newtime;

function closefcn(src,evnt)
        global f;
        global timer_id;
        disp('Closing figure... Bye!');

global f;
f = figure;

global timer_id;
timer_id = add_input_event_hook(@timer_Callback);

Fri 10 Feb 2012 05:42:22 PM UTC, comment #2: 

Re-titling to reflect the actual issue in question.

The desired Matlab function is documented here (http://www.mathworks.com/help/techdoc/ref/timer.html).

Rik <rik5>
Group administrator
Thu 03 Feb 2011 06:14:22 AM UTC, comment #1: 

If you want advice or help, please use the -email is unavailable- mailing list.

But since this report does mention a function that is in Matlab and missing from Octave, I've tagged this as a feature request and lowered the priority accordingly.

John W. Eaton <jwe>
Group administrator
Tue 01 Feb 2011 04:11:09 PM UTC, original submission:  

Greetings All

I'm trying to create a function which runs at different times very much how the hands of a clock works.  I planned on using the timer function to vary the rate at which they run like in this link

but octave does not have this.  Is there an add-on package I need to install or does someone know of a better way of doing this.

Example of what I'm trying to do
1) have several objects that go from 0-360 degrees
incrementing by 1
2) the clock example is the best one I can think of
0-360 degrees in 1 second
0-360 degrees in 1 minute
0-360 degrees in 1 hour
Is there a way to do this in octave?




(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by farhi (Posted a comment)
  • -email is unavailable- added by rtc (Posted a comment)
  • -email is unavailable- added by gilo (Posted a comment)
  • -email is unavailable- added by marthasimons (Updated the item)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by lostbard
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-30 mtmiller Carbon-CopyRemoved 80942 -
    2018-03-23 mtmiller Attached File#43648 Removed
    2018-03-23 marthasimons Attached File- Added to Do.pdf, #43648
    2014-08-09 lostbard Carbon-Copy- Added -email is unavailable-
    2014-03-27 mtmiller CategoryLibraries Octave Function
        StatusNone Confirmed
        Release3.2.3 dev
        Operating SystemGNU/Linux Any
    2012-02-10 rik5 SummaryFeature request: timer function and octave 3.2.3 tia sal22 Feature request: timer object functions
    2011-02-03 jwe Severity3 - Normal 1 - Wish
        Priority5 - Normal 1 - Later
        Item GroupNone Feature Request
        Summarytimer function and octave 3.2.3 tia sal22 Feature request: timer function and octave 3.2.3 tia sal22

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code