fix computing duration for each task
parent
09e1c57f32
commit
f6da50ff6f
11
src/main.rs
11
src/main.rs
|
|
@ -91,11 +91,12 @@ fn log(f: &String, enabled: &bool, since: &Option<String>) -> Result<(), String>
|
|||
curr.t = x.timestamp();
|
||||
curr.d = 0.0;
|
||||
}
|
||||
let d = match curr.xs.len() {
|
||||
0 if x.x.len() == 0 => 0.0,
|
||||
0 => 1.0,
|
||||
_ => ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32,
|
||||
};
|
||||
let mut d = 1.0;
|
||||
if x.x.len() == 0 {
|
||||
d = 0.0;
|
||||
} else if i > 0 {
|
||||
d = ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32;
|
||||
}
|
||||
match x.x.len() {
|
||||
0 => {},
|
||||
_ => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue