@ 2015-12-30T22:34:14Z <?php
function bufferScrobble($timecode, $artist, $title) {
session_start();
if (isset($_SESSION['timecode'])) {
echo "coucou";
//Chanson bufferisée
if($timecode == $_SESSION['timecode']) {
//Même chanson, bonne à scrobbler
echo "scrobble ".$_SESSION['timecode']." ".$_SESSION['artist']." ".$_SESSION['title'];
session_destroy();
}
else if(($timecode - $_SESSION['timecode']) < 0) {
//Une chanson revient après ses +30sec mais on est déjà passé à la suivante
break;
}
else if(($timecode - $_SESSION['timecode']) < 30) {
//Chanson bufferisée trop courte, on passe à la nouvelle
$_SESSION['timecode'] == $timecode;
$_SESSION['artist'] == $artist;
$_SESSION['title'] == $title;
session_write_close();
sleep(30);
bufferScrobble($timecode, $artist, $title);
}
else {
//Chanson bufferisée suffisamment longue, on la scrobble et on bufferise la nouvelle
echo "scrobble ".$_SESSION['timecode']." ".$_SESSION['artist']." ".$_SESSION['title'];
$timecode == $_SESSION['timecode'];
$artist == $_SESSION['artist'];
$title == $_SESSION['title'];
session_write_close();
sleep(30);
bufferScrobble($timecode, $artist, $title);
}
}
else {
$_SESSION['timecode'] == $timecode;
$_SESSION['artist'] == $artist;
$_SESSION['title'] == $title;
session_write_close();
sleep(30);
bufferScrobble($timecode, $artist, $title);
}
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.0.1 0.003 0.043 20.19 7.0.0 0.013 0.080 20.08 5.6.21 0.007 0.053 20.52 5.6.20 0.003 0.057 18.18 5.6.19 0.013 0.080 20.35 5.6.18 0.053 0.037 20.63 5.6.17 0.037 0.067 20.46 5.6.16 0.007 0.053 20.44 5.6.15 0.003 0.080 18.18 5.6.14 0.000 0.040 18.18 5.6.13 0.003 0.040 18.27 5.6.12 0.020 0.067 21.04 5.6.11 0.007 0.037 21.04 5.6.10 0.010 0.080 21.13 5.6.9 0.017 0.080 21.05 5.6.8 0.010 0.077 20.50 5.5.35 0.030 0.073 20.55 5.5.34 0.013 0.053 17.95 5.5.33 0.007 0.070 20.41 5.5.32 0.030 0.037 20.24 5.5.31 0.030 0.060 20.26 5.5.30 0.003 0.063 17.98 5.5.29 0.003 0.040 17.99 5.5.28 0.007 0.053 20.89 5.5.27 0.010 0.070 20.81 5.5.26 0.010 0.083 20.66 5.5.25 0.007 0.063 20.63 5.5.24 0.013 0.077 20.25
preferences:dark mode live preview
141.28 ms | 1394 KiB | 7 Q