Questions tagged [execution-time]

Execution time refers to how long it takes a particular program to execute.

Use this tag for questions related to measuring or improving the execution time of a particular piece of code.

724 questions
-2
votes
1 answer

Convert traditional for loop into Java Stream

I'm trying to convert traditional for loop into Java Stream, but some problems are occurring. Basically, my Method execution taking too much time.When I describe reducing the method execution time. When converting the traditional for loop into…
Ng Sharma
  • 2,072
  • 8
  • 27
  • 49
-2
votes
1 answer

Writing Custom FPrintF

I have to make my own fprintf method, but by comparing the execution time of my method with the standard one, mine is almost 3 times slower. What have I done wrong? void FPrintF(const char *aFormat, ...) { va_list ap; const char *p; int…
Brian Batista
  • 67
  • 1
  • 6
-2
votes
1 answer

Max Execution time Error after 1 year working

I have the code below, and it was working fine for over an year now, but today it's giving a max execution time error. I tried increasing the numbers on php.ini but it did not resolve. Also tried adding the max_execution_time directly into the php…
Samara Galvão
  • 119
  • 3
  • 14
-2
votes
1 answer

I want to be able to measure the time of execution of this 2 functions but can't wrap my head around it

This is the code and I want to measure. I would love some help, I'm new to coding. I want to see the difference in execution time between the two functions that can be randomly selected. #include #include #include…
-2
votes
3 answers

How to test Microsoft Dynamics CRM 2016 Plug_ins with Benchmark

I'm working with Dynamics CRM 2016, i have developped specified plug_ins. On my first test, my process stay so long that time out exception is displayed. I optimized my code, reorgonized my plug_ins, than i test for the second time. It's now more…
-2
votes
1 answer

Clustered and non-clustered index seeking increase execution time in stored procedure

I have a stored procedure which takes over 3 minutes to execute, when I show the execution plan I find Clustered index seeking and non-clustered index seeking index seeking clustered index seek My query: SELECT distinct …
-2
votes
1 answer

How to calculate O(n) for two variables that increases differently in loop?

I tried many way and i created n,i,t value table.I noticed that n=1 loop 0 time returns,n=2 loop=1 time ,n=3 or 4 loop=2 time, n=5,6 or 7 loop=3 ,n=8,9,10,11 loop=4 four time i found these values full-comprehend but i does not find solution O(n) for…
Moustafa51
  • 23
  • 4
-2
votes
1 answer

Execution time of int(raw_input() and converting raw_input() to int manually

Here is my code import datetime n = raw_input() print "aaa" a = datetime.datetime.now() for i in xrange(1,100000): x = 0 for i in n: x = ord(i)-48 + 10*x b = datetime.datetime.now() print x,b-a n = raw_input() print "aaa" a =…
Pratyush Dhanuka
  • 1,405
  • 2
  • 11
  • 21
-3
votes
1 answer

C# create multiple tasks, execution per task is slower than one not parallel

i have this part of code bool hasData = true; using (Context context = new Context()) { using (SemaphoreSlim concurrencySemaphore = new SemaphoreSlim(MAX_THREADS)) { while (hasData) { Message message =…
-3
votes
2 answers

What is the difference?

I was wondering,is there a difference in execution time between ++i and i++ in the for loop increment? 1)for(int i=0;i<100;++i) 2)for(int i=0;i<100;i++) I have heard that the one with the pre-increment uses less registers, and hence, it is…
-3
votes
1 answer

SQL Query Optimization

I have this query which takes about 52 second to be executed I have been meaning to use Cursors or anyway that could help me to optimize the execution time select * from ( select distinct 'Net Sales' Class, SUM (…
-3
votes
1 answer

JAVA: Computing execution time giving runtime error

I've been working on a project to show that reading input using Scanner is slower than using buffered reader which is in turn is slower than using our own functions which parse integer using suitable manipulation. For this I'm noting down the…
CPPCoder
  • 155
  • 1
  • 1
  • 10
-4
votes
3 answers

CodeSignal: Execution time limit exceeded with c++

I am trying to solve the programming problem firstDuplicate on codesignal. The problem is "Given an array a that contains only numbers in the range 1 to a.length, find the first duplicate number for which the second occurrence has minimal…
thedro0-0
  • 1
  • 3
-4
votes
1 answer

how to minimize the execution time for a java program?

I have created a program in java for entering 1000 random numbers into two different database one for odd numbers and one for even. The code is executing fine but it takes nearly a minute to execute. How can I minimize the Execution time? Here is…
sujitha
  • 17
  • 1
-5
votes
2 answers

Finding maximum value in Python vs. C++

I am just curious as to why finding the maximum value in C++ is faster than in Python3. Here is a snippet of my code in both languages: C++: int main() { int arr[] = {45, 67, 89}; int temp = 0; for(int n = 0; n < 3; n++) { …
zhongtan
  • 177
  • 3
  • 13
1 2 3
48
49