This can work when mining against pool but cannot be used for solo mining at higher diff; in that situation you can mine several days without block or share and Last valid work cannot be used.
...
I really did say that coz it is correct ...
I added "Last Valid Work" to cgminer coz it is the best way to determine something is wrong.
It has nothing to do with shares or difficulty.
It is the last time a valid hash was returned by the device.
Tested and it doesn't work for solo mining. I calculated "timeout" from devs data, like
devs.STATUS.When-devs.DEVS(x).Last Valid Work; I see that timeout can be high even for healthy card...
(
[STATUS] => S
[When] => 1375430059
[ Code] => 9
[Msg] => 0 GPU(s) - 3 ASC(s) - 6 PGA(s) -
[Description] => Subaru
)
[ASC0] =>
(
[ASC] => 0
[Name] => BAS
[ID] => 0
[Enabled] => Y
[Status] => Alive
[Temperature] => 67.00
[MHS av] => 61520.46
[MHS 5s] => 61445.47
[Accepted] => 5040
[Rejected] => 30
[Hardware Errors] => 19392
[Utility] => 3.35
[Last Share Pool] => 0
[Last Share Time] => 1375430055
[Total MH] => 5561359878.0407
[Diff1 Work] => 1292409
[Difficulty Accepted] => 1271115.00000000
[Difficulty Rejected] => 7680.00000000
[Last Share Difficulty] => 256.00000000
[No Device] => false
[Last Valid Work] => 1375430059
)
1375430059-1375430059=0
Yep a BAS (61.5GH/s) will average >14 results a second so will usually be 0
For an AMU as it says 335MH/s
(
[STATUS] => S
[When] => 1375430228
[ Code] => 9
[Msg] => 0 ASC(s) - 3 PGA(s) -
[Description] => Pi
)
[PGA0] =>
(
[PGA] => 0
[Name] => AMU
[ID] => 0
[Enabled] => Y
[Status] => Alive
[Temperature] => 0.00
[MHS av] => 335.97
[MHS 5s] => 335.36
[Accepted] => 35
[Rejected] => 0
[Hardware Errors] => 90
[Utility] => 0.02
[Last Share Pool] => 0
[Last Share Time] => 1375428250
[Total MH] => 37978409.3286
[Frequency] => 0.00
[Diff1 Work] => 8761
[Difficulty Accepted] => 7430.00000000
[Difficulty Rejected] => 0.00000000
[Last Share Difficulty] => 256.00000000
[No Device] => false
[Last Valid Work] => 1375430227
)
It will average 12.8 seconds
Variance of up to 8 times is not rare so 102 would not be unexpected
(My script that checks it for my old Icarus that sometimes stops working uses a factor of 21.2 to restart cgminer)
Of course if you get a hardware error, that won't count - so consider that like doubling the time ... then a few HW in a row ... and ...