diff options
Diffstat (limited to 'retroarch.hmod/bin/retroarch-watchdog')
-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 |