Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Metronome/Delphi/metronome.delphi
Normal file
27
Task/Metronome/Delphi/metronome.delphi
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
program Metronome;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
Winapi.Windows,
|
||||
System.SysUtils;
|
||||
|
||||
procedure StartMetronome(bpm: double; measure: Integer);
|
||||
var
|
||||
counter: Integer;
|
||||
begin
|
||||
counter := 0;
|
||||
while True do
|
||||
begin
|
||||
Sleep(Trunc(1000 * (60.0 / bpm)));
|
||||
inc(counter);
|
||||
if counter mod measure = 0 then
|
||||
writeln('TICK')
|
||||
else
|
||||
writeln('TOCK');
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
StartMetronome(120, 4);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue