Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Measuring time in milliseconds

  • aleksandrina555
  • aleksandrina555's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 1 day ago #93871 by aleksandrina555
Measuring time in milliseconds was created by aleksandrina555
Hello everyone!
LimeSurvey saves time of answering to each question in seconds. I was wondering if there is possibility to measure time in milliseconds?
Thank you!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 19 hours ago #93898 by tpartner
Replied by tpartner on topic Measuring time in milliseconds
Not "out of the box".

You could add a question to every group and use JavaScript to hide them and load the exact time between page load and submit click.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
11 years 15 hours ago #93941 by helper
Replied by helper on topic Measuring time in milliseconds
Open .../application/controllers/admin/responses.php
find the following:
Code:
                    $minutes = (int) ($browsedatafield[$i] / 60);
                    $seconds = $browsedatafield[$i] % 60;
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= "$minutes min ";
                    $browsedatafield[$i] .= "$seconds s";
replace with:
Code:
                    $minutes = (int) ($browsedatafield[$i] / 60);
                    $seconds = $browsedatafield[$i] % 60;
                    $ms = $browsedatafield[$i] % 1000;
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= "$minutes min ";
                    $browsedatafield[$i] .= $seconds.".".$ms." s";
The topic has been locked.
More
10 years 11 months ago #93993 by helper
Replied by helper on topic Measuring time in milliseconds
Better:
Code:
                    $minutes = $browsedatafield[$i] / 60;
                    $min = (int) $minutes;
                    $seconds = sprintf("%.2f",($minutes - $min) * 60);
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= $min."m ";
                    $browsedatafield[$i] .= $seconds."s ";
The topic has been locked.
  • aleksandrina555
  • aleksandrina555's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 11 months ago #94053 by aleksandrina555
Replied by aleksandrina555 on topic Measuring time in milliseconds
Thank you a lot!
The topic has been locked.
More
10 years 11 months ago #94063 by helper
Replied by helper on topic Measuring time in milliseconds
Glad that things worked out for you... just a word of caution though - If you do an update to your LimeSurvey, the changes that you made to the file may be overwritten.
The topic has been locked.
More
10 years 8 months ago #97885 by ahavlik
Replied by ahavlik on topic Measuring time in milliseconds
where it says: $ms = $browsedatafield[$i] % 1000;

it worked if instead we did: $ms = ($browsedatafield[$i]*1000) % 1000;
for version 1.91+
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose