{"id":20989159,"url":"https://github.com/latchdevel/uptime-arduino-library","last_synced_at":"2026-05-19T07:36:33.255Z","repository":{"id":263317733,"uuid":"888622060","full_name":"latchdevel/Uptime-Arduino-Library","owner":"latchdevel","description":"Streamlined \"uptime\" library for Arduino to get the device runtime.","archived":false,"fork":false,"pushed_at":"2024-11-18T15:49:34.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T07:46:00.347Z","etag":null,"topics":["arduino","counter","lighted","miliseconds","millis","streamlined","uptime"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/latchdevel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T18:02:19.000Z","updated_at":"2024-11-18T15:49:56.000Z","dependencies_parsed_at":"2024-11-17T20:43:21.200Z","dependency_job_id":"8c2146a7-30cb-4637-bb2f-cdf937aebc2b","html_url":"https://github.com/latchdevel/Uptime-Arduino-Library","commit_stats":null,"previous_names":["latchdevel/uptime-arduino-library"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchdevel%2FUptime-Arduino-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchdevel%2FUptime-Arduino-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchdevel%2FUptime-Arduino-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchdevel%2FUptime-Arduino-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/latchdevel","download_url":"https://codeload.github.com/latchdevel/Uptime-Arduino-Library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243401482,"owners_count":20285051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","counter","lighted","miliseconds","millis","streamlined","uptime"],"created_at":"2024-11-19T06:23:59.848Z","updated_at":"2026-05-19T07:36:33.190Z","avatar_url":"https://github.com/latchdevel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uptime Lighted\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n[![Compile Tests](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/CompileTests.yml/badge.svg)](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/CompileTests.yml)\n[![Native Tests](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/NativeTests.yml/badge.svg)](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/NativeTests.yml)\n[![Arduino Lint](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/ArduinoLint.yml/badge.svg)](https://github.com/latchdevel/Uptime-Arduino-Library/actions/workflows/ArduinoLint.yml)\n\nStreamlined \"uptime\" library for Arduino to get the device runtime.\n\nThis header-only library implements \"uptime\" functionality using Arduino's internal milliseconds counter returned by the \"millis()\" function, available on all Arduino platforms.\n\nThe Arduino \"millis()\" function returns the **32-bit milliseconds counter** whose value is the number of milliseconds elapsed since startup.\nThe maximum value of this counter is (2^32)-1 = 4294967295 milliseconds, which resets after 49 days, 17 hours, 2 minutes, 47 seconds, and 295 milliseconds.\n\nThe Uptime Arduino Library uses a **32-bit seconds counter** to store the number of seconds elapsed since startup, which is reset after 4294967295 seconds, more than 136 years.\n\n## Usage\nThe `uptime()` function updates counters and returns a human-readable \"uptime\" string, from **\"00:00:00\"** to the maximum **\"49710d 06:28:15\"**.\nThis function, or `update()`, must be called frequently to update the counters, at least once every 49.7 days.\n```c++\nconst char* uptime(void); \n```\n**Example:**\n```c++\n#include \u003cUptime.h\u003e\n\nvoid setup() {\n  Serial.begin(115200);\n}\n\nvoid loop() {\n  Serial.println( uptime() );\n  delay(1000);\n}\n```\n\n**Output:**\n```\n00:00:00\n00:00:01 \n00:00:02\n...\n23:59:59\n1d 00:00:00\n1d 00:00:01\n...\n```\n\nTry running this simple example on Arduino UNO here: [**WOKWI Uptime-Arduino-Library-Simple-Example**](https://wokwi.com/projects/414108225387053057)\n\nOr try running the full example on Arduino UNO here: [**WOKWI Uptime-Arduino-Library-Complete-Example**](https://wokwi.com/projects/414108308610447361)\n\nOr try running the full example on native platform here: [**ONLINE CPP non-Arduino Complete Example**](https://www.online-cpp.com/NIlDZ8UMSb)\n\n## Similar libraries\n - **Arduino UpTime** https://github.com/jozef/Arduino-UpTime\n - **Uptime Library** https://github.com/YiannisBourkelis/Uptime-Library\n - **Uptime** https://github.com/XbergCode/Uptime\n\n# License\nCopyright (c) 2024 Jorge Rivera. All right reserved.\n\nLicense GNU Lesser General Public License v3.0.\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with this program; if not, write to the Free Software Foundation,\nInc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\nSee the [LICENSE](LICENSE.txt) file for license rights and limitations (lgpl-3.0).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatchdevel%2Fuptime-arduino-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flatchdevel%2Fuptime-arduino-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatchdevel%2Fuptime-arduino-library/lists"}