gish Posted December 23, 2008 Share Posted December 23, 2008 hi phpfreaks I want to create a timer in php. What I want to know would it be appropriate to use a session variable. I am having trouble with the concept I think. Has anyone created one before? thanks gish Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/ Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 You should use a client side language for this perhaps JS? Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/#findComment-722683 Share on other sites More sharing options...
gish Posted December 23, 2008 Author Share Posted December 23, 2008 thanks Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/#findComment-722700 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 Check this out. Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/#findComment-722703 Share on other sites More sharing options...
Brian W Posted December 23, 2008 Share Posted December 23, 2008 well, it won't be 100% accurate cuz you will be dealing with delay from connection, loading, ect... but you could use sessions and time() or microtime(). First page has records the time in a session, then when some action occurs the next page i brought up which subtracts the session time from the new time getting seconds or microseconds since the first page was ran. But the other two are correct, JS would be your best choice. Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/#findComment-722736 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 gish, could you elaborate on what exactly you're trying to do? There may be an easier way to do this... Quote Link to comment https://forums.phpfreaks.com/topic/138229-stopwatch/#findComment-722742 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.