Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to design a costing system, which measures the time somebody is in a park and than calculates the total cost say ($0.10 per minute). I am than trying to display this on an LCD screen. This is in C programming and am still trying to get my head around using timers. Any help would be appreciated

What I have tried:

I am okay at moving data onto the LCD screen. However, I do not know where to start when trying to take a measured time and multiply it.
Posted
Updated 5-Aug-16 21:04pm

1 solution

Capture the time at the start and end of the activity, and then calculate the difference:
C++
time_t timeStart = time();
// do the activities
time_t timeEnd = time();
long seconds = timeEnd - timeStart;


See also time, _time32, _time64[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900