diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-02-19 00:09:30 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-02-19 00:09:30 +0300 |
commit | 33ad543b817fb597d763cc4aac6871310a0a72a1 (patch) | |
tree | 9257a07df37f98763388d314760aead93b91e1c6 | |
parent | b074c095893a1b36a73044ffa06b18692f95d46e (diff) |
Timestamps
-rw-r--r-- | retroarch.hmod/bin/retroarch-watchdog | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/retroarch.hmod/bin/retroarch-watchdog b/retroarch.hmod/bin/retroarch-watchdog index 71a9423..c246a42 100644 --- a/retroarch.hmod/bin/retroarch-watchdog +++ b/retroarch.hmod/bin/retroarch-watchdog @@ -7,6 +7,7 @@ rom=$3 id=$(echo $(basename "$rom") | cut -f 1 -d '.') autosave="/var/cache/$id.state.auto" rsram="/var/cache/$id.srm" +t_suffix=_time.txt shift 3 crt=0 @@ -52,6 +53,11 @@ else sed -i -e 's/video_shader = "[^"]*"/video_shader = ""/g' /etc/libretro/retroarch.cfg fi +# Start timestamp +ts=$(date +"%s") +tm=0 +[ -f "$load$t_suffix" ] && tm=$(cat "$load$t_suffix") + retroarch -c "$HOME/retroarch.cfg" -vfL "$core" "$rom" $extra & rpid=$! sleep 1 @@ -84,5 +90,10 @@ pkill -KILL ReedPlayer-Clover [ ! -z "$save" ] && [ -f "$autosave" ] && [ -z "$nosaves" ] && mv -f "$autosave" "$save" [ ! -z "$sram" ] && [ -f "$rsram" ] && mv -f "$rsram" "$sram" +# Time +ts2=$(date +"%s") +tm=$((tm + ts2 - ts)) +echo $tm > "$save$t_suffix" + # Back to shell clover-mcp |