Is there any way to make a timer that updates every second so i can see for how long my program is running. I tried making a loop:
i = 0
for i in range(1000000):
i += 1
time.sleep(1)
And then I want to print it into my discord.py bot. This is how it looks like:
async def on_ready():
os.system('cls')
print('', fg('red'))
print(' _____ _ ', fg('red'))
print('| ___| | __ _ _ __ _ __ _ _ ', fg('red'))
print("| |_ | |/ _` | '_ \| '_ \| | | |", fg('red'))
print('| _| | | (_| | |_) | |_) | |_| |', fg('red'))
print('|_| |_|\__,_| .__/| .__/ \__, |', fg('red'))
print(' |_| |_| |___/ ', fg('red'))
print(f'Up-Time: {i}')
print(f'Version: {version}', fg('blue'))
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~', fg('green'))
print('[Server]: The Bot is online.', fg('green'))
"Up-Time" is the place where i want the time to be displayed but when i try to run it, nothing shows up. But when i put print(i) below my loop, the only thing it does is print out the numbers, without the actual server running.
Sorry if the explanation is not good enough, im super new to StackOverFlow and programming in general. And sorry if it bothers you, thank you in advance!