Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farazf19/mfaraz-digital-clock
https://github.com/farazf19/mfaraz-digital-clock
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/farazf19/mfaraz-digital-clock
- Owner: FarazF19
- Created: 2024-07-27T10:45:48.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T10:54:13.000Z (5 months ago)
- Last Synced: 2024-07-27T11:56:25.641Z (5 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Digital Clock with Recursion and Promises
This project demonstrates a simple digital clock implementation using JavaScript. It utilizes Promises and recursive function calls to print the current time every second.
## Overview
The `recPromise` function:
- Creates a new Promise that resolves with the current time (formatted as a string) after a delay of 1 second.
- Logs the resolved time to the console.
- Recursively calls itself to continue printing the time every second.## Usage
To run this code, simply copy and paste the function into a JavaScript environment (such as a browser console or Node.js environment) and execute it.
```
## Features
- Uses JavaScript Promises for asynchronous operations.
- Demonstrates recursion to create an infinite loop for the clock.
- Prints the current time every second in a human-readable format.## Requirements
- A JavaScript runtime environment (e.g., browser console or Node.js).
## License
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as you wish.
```This `README.md` file provides a brief overview, usage instructions, features, requirements, and licensing information for your simple digital clock project.