Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 21 made on Monday September 13, 2010 at 17:50
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
But that is just one way to calculate duration. A counter is not as accurate as the real millisecond value:

// in the button script or in onPress function of button, do:
this.pressTime = new Date().valueOf();

// in the button script, assign onHold and onRelease functions.
this.onHold = function()
{
var now = new Date().valueOf();
var holdTime = now - this.pressTime();
// holdTime resolution is in milliseconds.
};

this.onRelease = function()
{
var now = new Date().valueOf();
var finalTime = now - this.pressTime();
// finalTime resolution is in milliseconds.

// clean up member field in the widget
delete this.pressTime;
};
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse