CPCWiki forum

General Category => Programming => Topic started by: santi.ontanon on 17:03, 03 April 18

Title: Timing code in WinAPE
Post by: santi.ontanon on 17:03, 03 April 18
Hi guys!


I have a routine that I am optimizing, and I constantly need to measure its execution time. Right now I am just setting breakpoints in WinAPE before and after the routine, and copy pasting the values of "T" to EXCEL to do the subtraction every time. But this gets old very quickly, and also, if I want to get an average execution time over, say 100 executions, it takes forever. I come from the MSX world, and in OpenMSX, I just write a small TCL script that does this super easily, but I don't think it's possible to add scripts to WinAPE, right?


How is everyone else doing this kind of things?


Thanks!!! :)
Title: Re: Timing code in WinAPE
Post by: roudoudou on 17:39, 03 April 18
In case you didn't notice, the button next to this is a reset for the counter  ;D
Title: Re: Timing code in WinAPE
Post by: santi.ontanon on 17:44, 03 April 18
oh! no!!! didn't notice! hahaha  :doh:   Ok, that helps with the first problem! Thanks a lot!!


But for the second part, is there any easy way in WinAPE (or some other amstrad emulator) to get the average run-time of a piece of code after running a program for a while?
Title: Re: Timing code in WinAPE
Post by: Targhan on 22:00, 03 April 18
To my knowledge, it's not directly possible. I'm sure ACE can do that... If you're using MorphOS!


I automatized Winape to insert SNApshot and run them automatically, by using AutoHotKey. I'm sure you can do what you want with it, but it's gonna be a bit tricky and probably 100% reliable. But it should work.
Title: Re: Timing code in WinAPE
Post by: santi.ontanon on 01:37, 04 April 18
Oh! Thanks! I'll check that AutoHotKey thing!


And that ACE emulator looks very slick! I'll try to see if I get it running in a VM with MorphOS!!
Powered by SMFPacks Menu Editor Mod