@ 2015-12-30T22:34:46Z <?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 {
echo "hello";
$_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.30 7.0.0 0.013 0.080 20.14 5.6.28 0.003 0.047 21.09 5.6.21 0.013 0.047 20.72 5.6.20 0.003 0.083 18.25 5.6.19 0.007 0.077 20.47 5.6.18 0.030 0.050 20.60 5.6.17 0.037 0.043 20.51 5.6.16 0.013 0.077 20.43 5.6.15 0.003 0.070 18.14 5.6.14 0.003 0.037 18.15 5.6.13 0.010 0.077 18.28 5.6.12 0.007 0.050 21.11 5.6.11 0.003 0.040 21.03 5.6.10 0.003 0.087 20.98 5.6.9 0.007 0.053 21.14 5.6.8 0.007 0.080 20.44 5.5.35 0.030 0.077 20.41 5.5.34 0.003 0.047 18.09 5.5.33 0.003 0.080 20.40 5.5.32 0.063 0.063 20.36 5.5.31 0.027 0.040 20.30 5.5.30 0.000 0.043 17.98 5.5.29 0.007 0.070 17.95 5.5.28 0.013 0.033 20.98 5.5.27 0.007 0.083 20.77 5.5.26 0.007 0.070 20.64 5.5.25 0.010 0.080 20.58 5.5.24 0.023 0.067 20.09
preferences:dark mode live preview
134.01 ms | 1394 KiB | 7 Q