Skip to content

Commit 9bf282c

Browse files
committed
timer intervals and timeouts in milliseconds
1 parent 8150bab commit 9bf282c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ A callback function which will be passed to setTimeout/setInterval function.
5757

5858
interval: <mandatory>
5959

60-
Interval (in seconds) after which callback should be invoked.
60+
Interval (in milliseconds) after which callback should be invoked.
6161

6262
options: {}
6363

@@ -71,7 +71,7 @@ If set to true JS setTimeout() function will be used instead of setInterval(). T
7171

7272
timeout: false
7373

74-
If set to integer, interval timer will work only this parameter value seconds.
74+
If set to integer, timer function will stop after specified milliseconds.
7575

7676
startCallback/pauseCallback/resumeCallback/stopCallback: function() {}
7777

jquery.timer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ var jQuery = typeof(jQuery) === 'undefined' ? null : jQuery;
4242
};
4343

4444
options.interval = parseInt(options.interval, 10);
45-
options.interval = isNaN(options.interval) ? defaults.interval : options.interval * 1000;
45+
options.interval = isNaN(options.interval) ? defaults.interval : options.interval;
4646
options.timeout = parseInt(options.timeout, 10);
47-
options.timeout = isNaN(options.timeout) ? defaults.timeout : options.timeout * 1000;
47+
options.timeout = isNaN(options.timeout) ? defaults.timeout : options.timeout;
4848
this._options = $.extend(defaults, options);
4949

5050
this._timerFunction = options.useSetTimeout ? 'Timeout' : 'Interval';

0 commit comments

Comments
 (0)