|
Why did you delete your original question? I didn't see it, so now I have no idea what you are talking about.
---
single minded; short sighted; long gone;
|
|
|
|
|
1) Is there any way of determining/measuring the extent of the floating point part of my computation (as a % of runtime)?
2) Also, is there any way what to determine what currently dominates in my application - (I/O) or compute?
I guess what I need are some sort of monitoring functions?
Cheers
|
|
|
|
|
For 1.) Check out the PerformanceCounter class...you can set it to monitor the % of a method.
For 2.) I take it you want to find out what part of your application is most CPU intensive? If this is the case then check out in Visual Studio: (From the menu)
Tools->Performance Tools->Performance Wizard
This will get you started on getting statistics on all of your project's contained Methods.
|
|
|
|
|
Thank you.... I will check out the PerformanceCounter Class.
I can't find the performance wizard in the tools menu. Is this available in VS 2003?
|
|
|
|
|
I believe it is new to 2005. Check out FxCop
|
|
|
|
|
A better idea. Get a profiler. This[^] is a fine example of one from RedGate.
|
|
|
|
|
I have a csharp windows application, i am using Mysql database, i need to provide a utility from the application to backup and restore database.
I can run the following commands from the Dos shell, but i need to run the same from the csharp code. I used the folder browser and file dialog to get the path
and created the following string "mysqldump -u root -p XXXX emanage > c:\emanage.sql" . can some one help me out by telling how to run a command from csharp code.
Thanks in advance
|
|
|
|
|
To run a command in DOS generally
System.Diagnostics.Process.Start("cmd", "command comes here"); is used
-- modified at 7:34 Thursday 11th October, 2007
Koushik
|
|
|
|
|
The the above script just opens the dos console and does not run the command in the entered string. How do i run the command automatically.
|
|
|
|
|
Hey why don't u keep the required command in a batch (.bat) file and then run the batch file using..
System.Diagnostics.Process.Start(@"filename");
Koushik
|
|
|
|
|
Thanks for the reply, i did a mistake earlier, i put cmd in the command string and actual command in the parameters, but now its resolved.
Thanks again.
|
|
|
|
|
string ls_path = @"c:\csharpbkp.sql";
System.Diagnostics.Process.Start("mysqldump", "-u root -p emanage >" + ls_path );
why does this not work,
|
|
|
|
|
Probably there is no process or filename by mysqldump ...
Anyhow u got the answer right...
Koushik
|
|
|
|
|
I am using a batch file for now, but there is a process names mysqldump and it works fine on the command prompt and with the batch file.
|
|
|
|
|
<br />
public delegate void updatevalores(int total);<br />
<br />
public partial class FormConexiones : Form<br />
{<br />
private int procesosactuales = 0;<br />
public FormConexiones()<br />
{<br />
InitializeComponent();<br />
}<br />
private void FormConexiones_Load(object sender, EventArgs e)<br />
{<br />
procesos proces = new procesos();<br />
Thread pid = new Thread(new ThreadStart(proces.iniciar(new updatevalores(actualizarv))));<br />
pid.Start();<br />
}<br />
<br />
public void actualizarv(int total)<br />
{<br />
procesosactuales = total;<br />
}<br />
}<br />
Another Class:
class procesos {<br />
{<br />
struct sproceso<br />
{<br />
public int id;<br />
public string NombreProceso;<br />
public string DirProceso;<br />
public string FileProceso;<br />
public DateTime tiempoinicio;<br />
}<br />
ArrayList listaprocesos = new ArrayList();<br />
bool existeproces = false;<br />
bool coincide = false;<br />
Timer nuevotiempo = new Timer();<br />
<br />
public void iniciar(updatevalores procesoact)<br />
{<br />
<br />
nuevotiempo.Elapsed += new ElapsedEventHandler(TiempoEjecutar);<br />
nuevotiempo.Interval = 5000;<br />
nuevotiempo.Enabled = true;<br />
}<br />
<br />
}
The Line Thread pid = new Thread(new ThreadStart(proces.iniciar(new updatevalores(actualizarv)))); has give me an error.
How i can pass values to proces.iniciar method??????????
Thanks
|
|
|
|
|
Hello,
This[^] should help!
All the best,
Martin
|
|
|
|
|
public delegate void updatevalores(int total);<br />
<br />
public partial class FormConexiones : Form<br />
{<br />
private int procesosactuales = 0;<br />
public FormConexiones()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void FormConexiones_Load(object sender, EventArgs e)<br />
{<br />
procesos proces = new procesos();<br />
Thread pid = new Thread(new ParameterizedThreadStart(proces.iniciar));<br />
pid.Start(new updatevalores(actualizarv));<br />
}<br />
public void actualizarv(int total)<br />
{<br />
procesosactuales = total;<br />
}<br />
}
Give me an error with
ParameterizedThreadStart(proces.iniciar)
The error is: none overload correspond 'iniciar' match with 'System.Threading.ParameterizedThreadStart' delegate
what the
|
|
|
|
|
damn
i forget to read:
This is simple, but only accepts a single parameter and isn't type-safe (just like the options when using thread pool threads)
:->
|
|
|
|
|
So you are fine with that?
All the best,
Martin
|
|
|
|
|
Yep
Works Fine:
procesos proces = new procesos();<br />
ThreadStart inipro = delegate { proces.iniciar(new updatevalores(actualizarv)); };<br />
new Thread(inipro).Start();
Ok, so much battle with Thread and asyncronic querys...
time to rest
thanks for all
|
|
|
|
|
Sleep well!
You are wellcome!
All the best,
Martin
|
|
|
|
|
y me getting also feel to sleep..............
a very long conversation to a simple problem...
Thanks and regards
manoj Kumar Jha
|
|
|
|
|
What are webparts?What is the use of webparts
|
|
|
|
|
what is google[^] ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: what is google[^] ?
Oohhh!!! Are we playing Jeopardy now?
|
|
|
|