JSFiddle - React, Tailwind, and code Playground

by Eric Duncan

HTML

<p>You are expected to find a block in roughly <span id="result">0.0</span> days.<br /><br />Good luck!</p>

JavaScript

var your_hashrate_in_khash = 1200;    // change this
var difficulty_factor = 9.95752152;    // update this, use www.coinwarz.com to find it.

// formula: difficulty * 2**32 / hashrate
var estimate_in_days = difficulty_factor * Math.pow(2,32) / your_hashrate_in_khash / 1000 / 60 / 60 / 24;

document.getElementById("result").innerHTML = estimate_in_days.toFixed(2);