TheSeven, could you explain what you're doing here?
I am porting this stuff to C and i am wondering about those magic numbers like 94.738 and 45.335163.
self.log("Endtime: %f\n" % endtime)
delta = (endtime - starttime) - 0.0145
self.mhps = 45.335163 / delta
delta = min(60, delta * 94.738)
self.log("%f MH/s\n" % self.mhps, curses.A_BOLD)
self.fpgajobinterval = min(self.fpgajobinterval, max(0.5, delta * 0.8 - 1))
self.fpgapollinterval = min(self.fpgapollinterval, self.fpgajobinterval / 5)
self.log("FPGA job interval: ")
And why to multiply with 0.8 ??
0.0145 is the duration (in seconds) to upload the getwork to the FPGA and donwnload the nonce found.
45335163 is the number of nonces that will have been checked until the matching nonce is found, which means that during this time 45.335163 megahashes have been calculated.
94.738 == 2^32 / 45335163, which means that 94.738 times the measured time is needed for the FPGA to process the full getwork.
* 0.8 - 1 is just a precaution to give the software enough time to send a new getwork to the FPGA before it runs out of work, as it doesn't hurt if we miss out a couple of nonces at the end. Remember that the FPGA will keep working on the old getwork while a new one is being transmitted, and that it can even submit a share during that. (I just realized that a WORK ACK packet (0x01) might get lost if that happens!)