Update proof_of_work.py

This commit is contained in:
DIVYASREE S 2024-10-10 22:28:24 +05:30 committed by GitHub
parent 6ee3d9e1e6
commit 1e3b382c5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,5 @@ def proof_of_work(difficulty: int) -> int:
hash_result = hashlib.sha256(f"{nonce}".encode()).hexdigest()
if hash_result.startswith(prefix):
end = time.time() # Timing ends
print(f"Time taken: {end - start:.2f}s") # Print time taken
return nonce
nonce += 1