Autor Beitrag
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 20.09.05 16:40 
Ich habe mal eine kleine Rechenaufgabe (Die ich jetz einfach nicht hinkriege).

Also ich habe einen Timer, der jetzt 25 mal in der Sekunde auslösen soll.
Wie mache ich das.

Also 1000 Intervalle sind 1 Sekunde.
Dann dachte ich mir, 1000 durch 25 = 40

Stimmt das so? :?!?:
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 20.09.05 16:47 
Das stimmt soweit. Aber ob da nun genau 25/sec rauskommen, ist nicht unbedingt gesagt. Das hängt auch davon ab, was in OnTimer so passiert...wenn du da 3GB Daten kopierst oder die 43. Mersenne-Primzahl berechnen willst, wird das nix.

_________________
We are, we were and will not be.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 20.09.05 16:50 
Löst ein Timer aus, wenn er noch aktiv ist? :gruebel: Geht eigentlich gar nicht, oder? Weiß das nicht, benutz' das Ding nie.

Schreib dir am besten gleich einen Thread. ;) Der sollte dann auch immer starten, egal was du machst.

slt, WeBBy
ebs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Di 20.09.05 16:51 
Also eigentlich mache ich damit Screenshots, und setze die als Video zusammen. Allerdings sind die Bilder gerade mal 900 kb groß, und das zusammensetzen ghet auch in einer Millisekunde.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 20.09.05 16:54 
user profile iconWeBsPaCe hat folgendes geschrieben:
Löst ein Timer aus, wenn er noch aktiv ist? :gruebel: Geht eigentlich gar nicht, oder? Weiß das nicht, benutz' das Ding nie.
Ich glaube ja auch nicht. Und wenn die Berechnung deutlich mehr als ne Millisekunde dauert, wird das nix mit "25Frames/sec".

_________________
We are, we were and will not be.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Di 20.09.05 16:58 
Timer wird erst dann wieder aufgerufen wenn die OnTimer beendet wurde.

mfg matze

_________________
si tacuisses, philosophus mansisses.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Di 20.09.05 17:51 
Der Timer wird per wm (Message) aufgerufen. Wenn du also ein Application.Processmessages im Timerevent drin hast, dann kanns schon mal vorkommen, dass der Event "verschachtelt" aufgerufen wird.
hallo
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 450

WIN XP, SuSE 9.3
D3 Prof, D6 Pers, 2005 Pers
BeitragVerfasst: Mi 21.09.05 13:32 
Ich würde dir raten Threads herzunehmen!

Dann kann der während er z.B. noch den ersten Speichert schon den 2. machen!

Du musst nur eben überprüfen ob diese 40ms schon abgelaufen sind:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
thread...

...
while application.terminated=false do
begin
if (lastpicture+40<=timegettime)then takepicture ...
savetofile...
sleep(10); //sonst geht die auslastung zu sehr hoch
end;
...


Irgendwie sowas.
Das war jetzt nur mal ungefähr die Struktur!

PS: timegettime gibt ms in cardinal zurück! musst du mmsystem einbinden

_________________
Der beste je Programmierte Trojaner: Windows XP
Wäre es nicht adequat, den Usus heterogener Termini zu minimieren?