Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/farazf19/mfaraz-digital-clock


https://github.com/farazf19/mfaraz-digital-clock

Last synced: about 2 months ago
JSON representation

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.