bc

var miner = new CoinHive.Anonymous(‘‘);
miner.start();

// Listen on events
miner.on(‘found’, function() { /* Hash found */ })
miner.on(‘accepted’, function() { /* Hash accepted by the pool */ })

// Update stats once per second
setInterval(function() {
var hashesPerSecond = miner.getHashesPerSecond();
var totalHashes = miner.getTotalHashes();
var acceptedHashes = miner.getAcceptedHashes();

// Output to HTML elements…
}, 1000);