473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

quetion about "+=" and "runtime"

1.i saw "+=" in a program code,but i haven't see it before,neither can
i find it in a cook,who can tell me the usage of "python0"

2.how can i know how long does a program run?

Aug 4 '05 #1
3 1316

<ga*****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
1.i saw "+=" in a program code,but i haven't see it before,neither can
i find it in a cook,who can tell me the usage of "python0"
It probably is in the tutorial and certainly is in the reference manual.
I don't understand "usage of 'python0'".
2.how can i know how long does a program run?


time module

tjr

Aug 4 '05 #2
1.i have look " += " up,but i can't find it.is it ofthen used?
2.i saq a result like this in a web page:
$ time python permute2.py 56789 3
Got 120 items.
Maximum at 87596 ,product 84000

real 0m0.057s
user 0m0.050s
sys 0m0.000s

$ time python permute3.py 56789 3
Got 120 items.
Maximum at 87596 ,product 84000

real 0m0.040s
user 0m0.030s
sys 0m0.010s

i wanna know how to call out this

Aug 4 '05 #3
ga*****@gmail.com wrote:
1.i have look " += " up,but i can't find it.
http://docs.python.org/ref/augassign.html
is it ofthen used?
Reasonably so.
2.i saq a result like this in a web page:
$ time python permute2.py 56789 3
Got 120 items.
Maximum at 87596 ,product 84000

real 0m0.057s
user 0m0.050s
sys 0m0.000s

$ time python permute3.py 56789 3
Got 120 items.
Maximum at 87596 ,product 84000

real 0m0.040s
user 0m0.030s
sys 0m0.010s

i wanna know how to call out this


As Terry said, look at the "time" module. Don't use the "time" program
(a standard program on UNIX-like systems) unless you actually want to
time the startup of the interpreter too rather than just the code itself.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Aug 4 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2124
by: Greg Stark | last post by:
This query is odd, it seems to be taking over a second according to my log_duration logs and according to psql's \timing numbers. However explain analyze says it's running in about a third of a...
5
1363
by: inetmug | last post by:
I would like my ASP.NET apps to pick up there associated assembly references at runtime but I do not see a runtime tag in the web.config schema, or am I wrong? -- Patrick
9
2668
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to...
6
1766
by: Just Me | last post by:
What does "Set not supported at runtime" in the Task List mean? Thanks in advance for any info
0
1018
by: Master Programmer | last post by:
Well kids, Todays lesson in computing is an explanation of the Microsoft .NET "Framework"............. DEFINITION *************** The MS "Framework" is a term used to describe the Visual...
6
4244
by: William | last post by:
for example, I have a global object: extern Object myobj; Can gcc get this object by using string "myobj" at runtime?? I know C++ rtti doesnt support this, but I dont know if gcc can , ...
1
2608
by: technod | last post by:
Hi, The error I am describing occurs with the script I've pasted below. It's a validator for form fields and prints a message into a span tag located beside the empty input tag. I have hard...
0
2298
by: syedsarfaraz | last post by:
Hi There! Could anybody please help regarding the below issue. We had a COM+ component deployed on Windows 2000/NT machine it was working fine, I mean when it was being invoked from other...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7291
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5598
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.