Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
48 user(s) are online (45 user(s) are browsing Forums)

Members: 0
Guests: 48

more...

Support us!

Headlines

 
  Register To Post  

Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
Is there some precise timer (CLI command) around, giving timedifferences in ticks?
If not how could it be written?




Go to top
Re: Precise timer, ticks
Quite a regular
Quite a regular


See User information
By ticks, do you mean intuiticks (about 9 ticks per second), or DOS ticks (I think 50 per second) or what?

By precise it sounds more like you would like to have microseconds. How about the UNIX utime stuff?

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
I was thinking of Amiga DOS ticks 50 per second, but the idea is to time code snippets, without having to find out how many times you have to repeat them to have a signifciant number (say 2 significant digits)

Go to top
Re: Precise timer, ticks
Quite a regular
Quite a regular


See User information
Ok. So you simply want to read time repeatadly and stop looping when you have run like 1 second or so? I'm sure there are ways but I have never done it so I can't answer from the top of my head.

Isn't there some TimeOfDay or DateTime function or something in dos.library perhaps?

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@JosDuchIt
Quote:
I was thinking of Amiga DOS ticks 50 per second, but the idea is to time code snippets, without having to find out how many times you have to repeat them to have a signifciant number (say 2 significant digits)

I doubt if it's possible to get exact timing with a CLI command. Remember, Amiga is multitasking and the timing command and/or your code snippet could be paused for task switching by the OS.

Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@Deniil

I was not thinking to use loops, but to avoid them.
Using an interpreted language i can time using the system time, which has a precision of 1 sec.

However the OS, i read, maintains a system time in ticks.
So i just wondered if i can use this. If somebody has made a CLI command getting it, it might not be fully usable due to multitasking, i still would be interested; I would try to use it right now. I am interested in the source too of course (or snippet of anybody having used the corresponding OS4 call), but then i'l have to take up C again, which i can't before fall.


Go to top
Re: Precise timer, ticks
Not too shy to talk
Not too shy to talk


See User information

Here is a little program to measure time differences:
http://mitglied.multimania.de/thomasrapp/download/PreciseTime.lha
(see TimeTest script for usage example).
Resolution is micro seconds.

Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@Thomas,

a big thank you, exactly what i need.

Go to top
Re: Precise timer, ticks
Not too shy to talk
Not too shy to talk


See User information

Forgot to mention that it's 68k yet. I could make an OS4-native version when I come home tonight.

Go to top
Re: Precise timer, ticks
Just popping in
Just popping in


See User information
@JosDushIt

A while back I needed a way to time how long some commands took and wrote http://os4depot.net/share/utility/shell/timer.lha

It tries to be as accurate as possible and consequently it doesn't report the result in Ticks but you could make that happen by modifying the source code a bit.

A1-XE-G4 7455/933 - 2GB RAM - OS4.1 beta - Radeon 9200-256
Audigy2 - ESI Julia - Solo1 - X10 (cm11a) - WiFi (WAP11) - 2x80GB HDD
Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@thomas
On OS4 version seems like a good idea
@alexC
Thanks too: works OK, the ticks are not important ,i just started with the idea that this had more chances to be available.



Go to top
Re: Precise timer, ticks
Not too shy to talk
Not too shy to talk


See User information
Quote:

JosDuchIt wrote:
@thomas
On OS4 version seems like a good idea


Sorry, I almost forgot about it. I now made an OS4 version and also added the option to use ticks instead of microseconds.

The link is still the same as above.

Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@Thomas

Nice, thank you

Go to top
Re: Precise timer, ticks
Just popping in
Just popping in


See User information
In a shell type this;

Prompt "%N.%S <%E>"

You will now get the command execution time shown
in the prompt string when the command returns.

If you want it permanently, set it up in the s:shell-startup.


Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@collinw
sure an interesting thing to know. thanks
The other solutions have the advantage, that you can include them in a script, which was what i was looking for.

Go to top
Re: Precise timer, ticks
Just popping in
Just popping in


See User information

wait 5
echo $_RunTime



Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@colinw
Has that variable always been available in AmigaOS or is it new to OS4??
Is there a way to list all the local variables from the command line (for future reference).??

Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
Type set and setenv without arguments on Shell.

(Btw. I'd expect to get a list of all variables with get instead of set.)

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Precise timer, ticks
Just can't stay away
Just can't stay away


See User information
@TSK
Duh! It's in the docs. The variables are listed too. I was never aware of the "Viewer" variable either. That might be useful in a script.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project