Greetings. In light of recent discussions, and with a search around the forums, I've decieded to try and add a TimeStamp to my prompt lines within logs. Now, while I have the regular H:M:S stamp, I've tried to add to that, a millisecond timer for latency, to print how long since the prompt last went off. Currently, the last part, is not working.
Here is what I am Trying to do:
Anyone have an idea as to why its not working properly?
Thanks.
Here is what I am Trying to do:
4246h, 3771m, 18040e cexdb- <-Prompt
(10:39:40<Time, H:M:S 39.230 <Time since last prompt)
4246h, 3771m, 18040e cexdb-
(10:39:42 3.21)
But here's what is doing:
4246h, 3771m, 18040e cexdb-
(10:39:43 0.00)
Here I waited. About 2 minutes
4246h, 3771m, 18040e cexdb-
(10:43:24 0.00)
And finally, the code:
def Time(*args):
time_now = time.strftime("(%H:%M:%S ", time.localtime())
log = world.GetVariable("log")
previousTime = world.GetInfo(232)
if log == "1":
diff = world.GetInfo(232) - previousTime
world.WriteLog(time_now + fpformat.fix(diff,2) + str(")"))
previousTime = world.GetInfo(232)
Anyone have an idea as to why its not working properly?
Thanks.