Home > Back-end >  Timing for help, write small programs
Timing for help, write small programs

Time:09-22

Wrote a demining small programs, and now I want to give it to add a timer function, can realize the timing starts from the time they are playing games, to show the total at the end of the time,
But I don't know how to display the total available,,,
Please everyone a great god help, just not in the console,
By the way, ask again, can use messagebox display?

CodePudding user response:

It is always the starting time of the end time minus, what development tools do you use?

CodePudding user response:

 
#include

//program at the beginning of the
Starttime=time (NULL);
//program at the end of the
Endtime=time (NULL)

//endtime - starttime program run by time

CodePudding user response:

reference 1/f, Simple, Soft reply:
total available is minus the start time, end time what development tools do you use?

Visual Studio, EasyX, use & lt; Graphics. H> , I will write, but I can't show it on the screen

CodePudding user response:

When I write, but I can't show it on the screen,
I am using Visual Studio, EasyX, use & lt; Graphics. H> .

CodePudding user response:

The time difference is converted into a string, the time difference with outtextxy can output

CodePudding user response:

Simple reference 5 floor - Soft reply:
the time difference is converted into a string, the time difference with outtextxy output to can

Thank you, has been able to display time,
Have a question want to ask, I now program when the mouse movement on the window can display time, when the mouse away from the window time will stop, because I write cycle is a judgment of the mouse movement to continue, and I write the timer display program in the loop, what method can solve?

CodePudding user response:

You add a timer, update the timing in the timer, updated once a second

CodePudding user response:

reference 7 floor is Simple - Soft reply:
, you add a timer in the timer update timer, updated once a second

Thank you bosses, finally can use the
  • Related