Game timer please help!!!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Game timer please help!!!!!

Hello guys I want to create a game with timer the problem I don't know how to make it , so any ideas? thanks in advance.

7th Apr 2018, 8:10 PM
Coder++
Coder++ - avatar
8 Answers
8th Apr 2018, 6:40 PM
Anderson Schwartz
Anderson Schwartz - avatar
+ 4
c++
7th Apr 2018, 9:31 PM
Coder++
Coder++ - avatar
+ 3
thanh you that was helpful , but do you know a way to run it in same time with another function? I heard about thread but I don't know how to make one correctly
8th Apr 2018, 8:06 AM
Coder++
Coder++ - avatar
+ 3
thank you
8th Apr 2018, 7:37 PM
Coder++
Coder++ - avatar
+ 1
In what language?
7th Apr 2018, 9:30 PM
Anderson Schwartz
Anderson Schwartz - avatar
+ 1
In java i use Threads, i will read how do it in c++, if i find a way, i'll back here.
7th Apr 2018, 9:38 PM
Anderson Schwartz
Anderson Schwartz - avatar
+ 1
Hello, i don't know if it have error or if it doesn't work in my old phone, and i'm not with my cumputer... try this code.. but i think that you should do some research about "sleep" in c++. #include <iostream> #include <conio.h> #include <windows.h> using namespace std; void z() {Sleep(50);} char x[] = "Hello! This program writes each letter after 0.05 seconds. And it finally works :)"; int main(){ for (int i=0;i<81;i++) { cout << x[i]; z(); } getch(); return 0; }
7th Apr 2018, 10:22 PM
Anderson Schwartz
Anderson Schwartz - avatar
+ 1
What exactly you want create? i will send a lesson of sololearn where they talk about threads, but in java, so, you can put a Thread in your entire game, in all places that you want. sorry any thing, i'm learning english.
8th Apr 2018, 6:37 PM
Anderson Schwartz
Anderson Schwartz - avatar