[hashcash] "hashcash takes 1 second extra on windows" - possible cause/solution

  • From: bas <beware@xxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Fri, 10 Nov 2006 14:39:00 +0100

the problem: hashcash always takes a second on windows.
a guess at the cause of this problem: running in verbose mode, it takes this time "initial benchmark" finishes. also, it appears to always do this benchmark when minting. a benchmark itself (-s), too, is fast on linux, and slow on windows. a guess to why: CLOCKS_PER_SEC being 1000000 on linux, and a much lower value (1000?) on windows. and the test running for a given number of clocks (such as 1000). windows *can* have >1000000 clocks/sec timestamp accuracy, if you use the "performance counter" (queryperformancefrequency, queryperformancecounter). one could write a small "time" library which exposes the right things, and conditionally use it in windows instead of the normal one.


Other related posts: