RealTime System + Windows XP + C# or C

  • Thread starter =?ISO-8859-2?Q?Rafa=B3?=
  • Start date
?

=?ISO-8859-2?Q?Rafa=B3?=

Hi. Timer in C# not work, Thread + Loop + Sleep + DateTime.Now too not work
(Process.Prioritet = RealTime)
What i do wrong?
Best regards.

Rafal
 
J

Joona I Palaste

Rafa³ said:
Hi. Timer in C# not work, Thread + Loop + Sleep + DateTime.Now too not work
(Process.Prioritet = RealTime)
What i do wrong?
Best regards.

What you are doing wrong is using a completely different language than
C. Despite the name, C# has nothing to do with C.
 
G

Guest

Joona said:
What you are doing wrong is using a completely different language than
C. Despite the name, C# has nothing to do with C.
What about C# application + C dll?
 
M

Martin Ambuhl

Rafał said:
Hi. Timer in C# not work,

Is anyone surprised that C# doesn't work.
Thread + Loop + Sleep + DateTime.Now too not work
(Process.Prioritet = RealTime)
What i do wrong?

1) Using C#
2) posting questions to comp.lang.c (where the C programming language is
discussed) about C#, a proprietary product of the evil empire,
purporting to be *some* programming language, but certainly not C.
 
G

Guest

Martin said:
Is anyone surprised that C# doesn't work.



1) Using C#
2) posting questions to comp.lang.c (where the C programming language is
discussed) about C#, a proprietary product of the evil empire,
purporting to be *some* programming language, but certainly not C.
ok, but i write in C too, when i use timer with C (SetTimer), when i
minimalize or maximalize other appliacation, my application (Mangement C
+ RealTime Priority):

time CLK I get in real
0,2s 0 0,23s etc
0,4s 1 0,5 etc
0,6s 0
0,8s 1
 
C

CBFalconer

Rafa? said:
What about C# application + C dll?

Dlls have nothing to do with C as discussed in c.l.c. Read the
'welcome' message that is posted here periodically.
 
K

Keith Thompson

Rafa³ said:
ok, but i write in C too, when i use timer with C (SetTimer), when i
minimalize or maximalize other appliacation, my application (Mangement
C + RealTime Priority):
[snip]

The C standard doesn't define anything called SetTimer. It must be an
exension that's specific to whatever implementation you're using. Try
asking in a newsgroup that's specific to your system (possibly
comp.os.ms-windows.programmer or one of its subgroups).
 
M

Martin Ambuhl

Rafał said:
ok, but i write in C too, when i use timer with C (SetTimer),

There is no such thing in C as 'SetTimer'.
I write in Lisp, Scheme, Fortran, Ada, Objective C, C++, Pascal, Perl,
Python, and several assembly languages. It may be a surprise to you,
but that doesn't make them topical in comp.lnag.c.
when i
minimalize or maximalize other appliacation, my application (Mangement C
+ RealTime Priority):

None of 'minimalize' or 'maximilize' or 'Mangement C + RealTime
Priority' have a damn thing to do with the C programming language.
Please get a clue. I suppose 'Mangement C' is a language for veteranians.
 
J

Joe Estock

Martin said:
Is anyone surprised that C# doesn't work.



1) Using C#
2) posting questions to comp.lang.c (where the C programming language is
discussed) about C#, a proprietary product of the evil empire,
purporting to be *some* programming language, but certainly not C.
heh, looks more like a lame attempt at visual basic + java ;)
 
S

Steven

ok, but i write in C too, when i use timer with C (SetTimer)...

The actual function for the timer, as defined by the GNU C library,
uses clock() to return the current time in milliseconds. However, I've
found that function, along with the Windows API's GetTickCount() are
only accurate to 16 milliseconds. When I need a high accuracy timer
(on Windows only, but since you are using C#, you are probably using
Windows anyway), I usually use Windows API's GetPerformanceFrequency()
to determine the CPU speed, then use GetPerformanceCounter() (or maybe
rdtsc...) to get the CPU time stamp, and divide the latter by the
former. That seems to work very well, except you need to do 64 bit
arithmetic or convert the value to double using shift-add.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,430
Latest member
7dog123

Latest Threads

Top