Skip to content

Commit 7a44875

Browse files
authored
example for rate option
1 parent 67bc9d1 commit 7a44875

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,26 @@ Supported locales as of June 22 2017 are:
147147
"am", "ar", "bn", "bg", "ca", "zh", "hr", "cs", "da", "nl", "en", "et", "fi", "fr", "de", "el", "gu", "hi", "hu", "id", "it", "ja", "kn", "ko", "lv", "lt", "ms", "ml", "mr", "mo", "ps", "fa", "pl", "pt", "ro", "ru", "sr", "sk", "sl", "es", "sw", "sv", "ta", "te", "th", "tr", "uk", "vi"
148148

149149
The desired locale can be set using the "**langSet**" option:
150+
151+
**Example:**
150152
```JavaScript
151153
$("div#clock").clock({"langSet":"de"});
152154
```
153155

154156
## Update Speed
155157

156-
Since v2.1.9 the "**rate**" option has been added so that the rate at which the clock is updated can be set on each clock. The value is in milliseconds. The rate defaults to 500, since at 1000 the clock tends to skew slightly and winds up skipping a second here and there. Instead with an update rate of 500ms the seconds in the clock remain a little more faithful to 1 second increments making for less skewing. When using the "v" Format Character in the "**timeFormat**" option to show milliseconds, bringing the rate down to 50 or 10 or even 1 millisecond will give a near millisecond faithful clock.
158+
Since v2.1.9 the "**rate**" option has been added so that the rate at which the clock is updated can be set on each clock. The value is in milliseconds. The rate defaults to 500, since at 1000 the clock tends to skew slightly and winds up skipping a second here and there. Instead with an update rate of 500ms the seconds in the clock remain a little more faithful to 1 second increments making for less skewing. When using the "v" Format Character in the "**timeFormat**" option to show milliseconds, bringing the rate down to 50 or 10 or even 1 millisecond (though the page may become processor intensive in this last case) will give a near millisecond faithful clock.
159+
160+
**Example:**
161+
```JavaScript
162+
$("div#clock").clock({"timeFormat":"h:i:s.v","rate":50});
163+
```
157164

158165
## Custom client generated timestamp
159166

160167
You can pass in a custom javascript timestamp:
168+
169+
**Example**
161170
```JavaScript
162171
var customDateObj = new Date();
163172
var customtimestamp = customDateObj.getTime();

0 commit comments

Comments
 (0)