The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 OriginC Code running time
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

shafei

USA
49 Posts

Posted - 02/03/2012 :  03:05:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
I am running a code in Origin C and I would like to know how much time it takes to finish.
Is there a command that automatically records the start and the end of the running process? Or one that tells you how much the whole process takes?
Thanks

Penn

China
644 Posts

Posted - 02/03/2012 :  04:29:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please try the difftime function.

Penn
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/03/2012 :  11:58:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much Penn!
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/06/2012 :  6:43:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Penn,
I tried to use the code you provided.
Surprisingly, it does not work!
First of all, time_t should appear in blue color in my Origin C code, which it does not. Second, the compilation generates no problem and my code works well. however, at the end of the process, I get the error message in windows script. No time is shown on screen.
Can you please help to figure this problem out?
Thanks
Go to Top of Page

Penn

China
644 Posts

Posted - 02/06/2012 :  10:07:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Which version of Origin you are using? I have tried this example in Origin 8.6, it works fine. And the time_t shows in black color, but not the blue color you mentioned. You said you got error message, could you please provide the error message you get?

Penn

Edited by - Penn on 02/06/2012 10:08:10 PM
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/07/2012 :  01:19:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The version I use is 8.1. I was expecting ti time_t show in blue but it is in black for me too!
The error is "....\BETAQUANTUMLOOP.CPP(12) :Origin C Function Runtime Error, Dataset cannot attach".
Go to Top of Page

Penn

China
644 Posts

Posted - 02/07/2012 :  03:43:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

From the error message, it seems not related to the example itself, but the code you wrote. Maybe you have tried to access a dataset that does not exist in your code. So, you can debug your code to see what the problem is.

Penn
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/07/2012 :  12:27:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I do not get such message until I used timediff. the code is running well, and I get the results. However, no time difference is shown!
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/07/2012 :  12:48:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tried difftime for another code. It worked well. there must be some inconsistencies in my original code. Any idea what "dataset not attached" implies?
Go to Top of Page

Penn

China
644 Posts

Posted - 02/07/2012 :  9:08:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Maybe you have tried to attach a dataset to a column, and the column may not exist, or something like that. If your code is not big, you can paste it here and then I can have a try. Better to tell how to run your code and the line where error happens.

Penn
Go to Top of Page

shafei

USA
49 Posts

Posted - 02/07/2012 :  9:09:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I moved the difftime command and it resolved the problem.
thank you for your efficient help!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000