- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Measuring time in milliseconds
- aleksandrina555
- Topic Author
- Offline
- New Member
Less
More
11 years 1 week 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!
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
11 years 1 week ago #93898
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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.
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.
- helper
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 7
11 years 1 week ago #93941
by helper
Replied by helper on topic Measuring time in milliseconds
Open .../application/controllers/admin/responses.php
find the following:
replace with:
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";
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.
- helper
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 7
11 years 1 week 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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
11 years 1 week ago #94053
by aleksandrina555
Replied by aleksandrina555 on topic Measuring time in milliseconds
Thank you a lot!
The topic has been locked.
- helper
- Offline
- Senior Member
Less
More
- Posts: 46
- Thank you received: 7
11 years 1 week 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.
- ahavlik
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 1
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+
it worked if instead we did: $ms = ($browsedatafield[$i]*1000) % 1000;
for version 1.91+
The topic has been locked.