diff --git a/.vscode/temp.sql b/.vscode/temp.sql new file mode 100644 index 0000000..e69de29 diff --git a/clockstatusbaritem.js b/clockstatusbaritem.js index 1016cfa..270eeab 100644 --- a/clockstatusbaritem.js +++ b/clockstatusbaritem.js @@ -14,7 +14,8 @@ class StatusBarItem { this._statusBarItem.tooltip = 'Click to insert into selection'; this._statusBarItem.show(); - this._interval = setInterval(() => this.refreshUI(), 1000); + this._refresh = vscode.workspace.getConfiguration('clock').refreshInterval * 1000 || 1000; + this._interval = setInterval(() => this.refreshUI(), this._refresh); this.refreshUI(); } @@ -29,4 +30,4 @@ class StatusBarItem { } } -module.exports = StatusBarItem; \ No newline at end of file +module.exports = StatusBarItem; diff --git a/package.json b/package.json index cb9f89b..4c31276 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,12 @@ ], "main": "./extension", "contributes": { - "commands": [{ - "command": "clock.insertDateTime", - "title": "Clock: Insert date and time" - }], + "commands": [ + { + "command": "clock.insertDateTime", + "title": "Clock: Insert date and time" + } + ], "configuration": { "type": "object", "title": "Clock configuration", @@ -40,6 +42,11 @@ "type": "string", "default": "hh:MM TT", "description": "Clock: Date format according to https://github.com/felixge/node-dateformat" + }, + "clock.refreshInterval": { + "type": "number", + "default": 1, + "description": "Refresh interval for clock (set longer to reduce power consumption)" } } } @@ -49,5 +56,10 @@ }, "dependencies": { "dateformat": "^1.0.12" + }, + "__metadata": { + "id": "50810048-1465-4380-9716-6cd466f2ef8e", + "publisherDisplayName": "Compulim", + "publisherId": "f9dbfd7c-f9a1-434c-9971-648ad2e23f96" } -} +} \ No newline at end of file