mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
time remaining in progress now seems to work...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5acd8d2afc
commit
75c78bf72a
@ -170,12 +170,10 @@ var ProgressActions = actions.Actions({
|
||||
: parseInt(value))
|
||||
: v) }
|
||||
|
||||
// XXX REMAINING_TIME
|
||||
var prev = cache.prev || 0
|
||||
value = cache.prev = updateValue('value', value)
|
||||
max = updateValue('max', max)
|
||||
|
||||
// XXX REMAINING_TIME
|
||||
// estimate time to completion...
|
||||
var t0 = cache.timestamp || Date.now()
|
||||
var t = (cache.timestamp = Date.now()) - t0
|
||||
@ -186,9 +184,9 @@ var ProgressActions = actions.Actions({
|
||||
avg > 0
|
||||
&& remaining.setMilliseconds(
|
||||
avg
|
||||
* (max-value)
|
||||
// make the estimate a bit pessimistic...
|
||||
* 1.3)
|
||||
* (max-value)
|
||||
// make the estimate a bit pessimistic...
|
||||
* 1.3)
|
||||
|
||||
// update not due yet...
|
||||
if('timeout' in cache){
|
||||
@ -277,10 +275,10 @@ var ProgressActions = actions.Actions({
|
||||
timeout
|
||||
&& clearTimeout(JSON.parse(timeout))
|
||||
|
||||
//* XXX REMAINING_TIME
|
||||
// time remaining...
|
||||
var t = remaining ?
|
||||
` t:-${
|
||||
// NOTE: we show hours only if > 0...
|
||||
var t = (remaining && remaining.valueOf()) ?
|
||||
` / -${
|
||||
remaining.toISOString()
|
||||
.substr(11, 8)
|
||||
.replace(/^00:/, '') }s`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user