Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download time Calculator html code not need java or css can work offline create txt file on pc rename it html
- <!DOCTYPE html>
- <html>
- <head>
- <title>Davide Spagocci Download Time Calculator internet Files GB Mbps</title>
- </head>
- <body>
- <h1>Davide Spagocci Download Time Calculator internet Files GB Mbps</h1>
- <form>
- <label for="file-size">File Size (GB):</label>
- <input type="number" id="file-size" step="0.1" required>
- <br>
- <label for="download-speed">Download Speed (Mbps):</label>
- <input type="number" id="download-speed" step="0.1" required>
- <br>
- <button type="button" onclick="calculateDownloadTime()">Calculate</button>
- </form>
- <div id="result"></div>
- <script>
- function calculateDownloadTime() {
- var fileSize = parseFloat(document.getElementById("file-size").value);
- var downloadSpeed = parseFloat(document.getElementById("download-speed").value);
- var downloadTime = fileSize * 1024 / (downloadSpeed / 8);
- var hours = Math.floor(downloadTime / 3600);
- var minutes = Math.floor((downloadTime % 3600) / 60);
- var seconds = Math.floor(downloadTime % 60);
- var result = document.getElementById("result");
- result.innerHTML = "Download Time: " + hours + " hours, " + minutes + " minutes, " + seconds + " seconds";
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement