Handle operation on timer sensor.

Usage

timer keyword is needed to instanciate this sting.

var timer = require('timer');

Data accessors

Methods

Events

Full Example

var timer = require('timer');

var dataResult = timer.data();



timer.every("exampleValue", function(data) {
    recorder.save(data);
    recorder.sync();
});

timer.at("exampleValue", function(data) {
    recorder.save(data);
    recorder.sync();
});

timer.once("exampleValue", function(data) {
    recorder.save(data);
    recorder.sync();
});

timestamp

Retrieve the represents the time of the operation..

timestamp();

Parameters

  • None.

Return

  • timestamp : Long, represents the time of the operation.

data

Returns every available seed.

data();

Parameters

  • None.

Returns

every

Starts a listener on the timer and executes some actions when it changes.

every(filters, callback);

Parameters

  • filters : JSON, defines the filters. Can be empty.
  • callback : Method executed when event triggered, returns TimerData object.

Return

  • token : Token used for canceling event listener.

at

Starts a listener on the timer and executes some actions when it changes.

at(filters, callback);

Parameters

  • filters : JSON, defines the filters. Can be empty.
  • callback : Method executed when event triggered, returns TimerData object.

Return

  • token : Token used for canceling event listener.

once

Starts a listener on the timer and executes some actions when it changes.

once(filters, callback);

Parameters

  • filters : JSON, defines the filters. Can be empty.
  • callback : Method executed when event triggered, returns TimerData object.

Return

  • token : Token used for canceling event listener.