<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><br>
><br>
> I like that. Save in zero at start, then every write_file just need replace<br>
> the last value.<br>
<br>
</div>what about something like:<br>
<br>
{start: 1396011589, stops: [1396011616, 1396045612]}<br>
<br>
an activity that was inappropriately closed and never logged a stop:<br>
<br>
{start: 1396011589}<br>
<div class=""><br>
<br></div></blockquote><div><br></div><div>IMHO, you want one stop for session. Sugar execute write_file every time</div><div>you switch activities, but you don't want save all of them, just the last.</div><div><br></div>
<div>Right now, you have: </div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">{launch_time: 1396011589, 1396011616, 1396045612}</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">
</div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">If you save the accumulated time in zero at start you will have:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">{session_time: 23960, 0, 5612}</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">
</div></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">Where 0 is a session not saved, for any reason.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">Gonzalo</span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br>
</span></div></div>
</div></div>