Questions tagged [time-limiting]
128 questions
3
votes
2 answers
PHP script ignores max_execution_time and stops at the 600th second
Script runs on shared hosting and obeys the root php.ini file. It uses PHP 5.4 so there's no safe_mode and it's not using .htaccess files.
I asked support if they have any limits, she said the timeout is two hours on their side.
On localhost it…

mu3
- 739
- 1
- 7
- 19
2
votes
1 answer
How does the Regular expression execution time limit work in Google Apps Script?
TLDR:
What is this arbitrary RegExp execution time limit, how long is it, and when does it apply (because it does not apply equally in all Google Apps Script contexts)? Also, why does it apply when there are already execution time limits for the…

Austin Gwiazdowski
- 23
- 3
2
votes
1 answer
iPhone: 5 seconds video capture
I would like to write code so that when the user presses a button, the camera is launched and records 5 seconds of video. In other words I want to have video capture but with a time limit.
Is there something inside the UIImagePickerController or…

tambeen
- 185
- 8
2
votes
1 answer
Spring MVC controller set time limit
I am launching a long process in al web request in Spring MVC and I would like to terminate it if the thread takes a long time. Are there anyway to set a maximum time to kill the thread in a Spring controller if it is too long? Is this the best…

Esteban S
- 1,859
- 5
- 22
- 43
2
votes
2 answers
Return a method when time limit is up in - java
i just started to learn programming (2 weeks ago), and i am trying to make a bot for a game. In the main class of the bot, there are 3 methods that needs to be returned within 2second, or it will return null. I want to avoid returning null and…

125ch209
- 35
- 1
- 6
2
votes
1 answer
Limiting user processor time and peek virtual memory with Job Objects
I'm writing an application runner on Windows which can limit processor user time and virtual memory for the application it will run. Idea is to have following:
runner.exe mem_limit_in_MB time_limit_in_sec command.exe command_arguments ...
My…

mario
- 191
- 1
- 6
2
votes
1 answer
How is the time limit calculated on CodeChef?
In the March challenge of CodeChef, Java solutions for the problem "Random Decreasing Function" have been accepted that take more than 30 seconds, but the given time limit is two seconds. This is well over two times (four seconds) allowed for Java.

Nikunj Banka
- 11,117
- 16
- 74
- 112
2
votes
2 answers
Time limit exceeded using Scanner - Java
I'm testing this code in Java with a problem from a programming Judge and I get a "time limit" error. I guess the scanner.hasNextDouble() thingy is not working somehow.
It works with the public inputs shown in the link but it throws this time limit…

FullAdder
- 21
- 1
2
votes
1 answer
php stream_socket_client timeout does not work as expected
i have written a class which checks ssl vertificates via php stream_socket_client.
however timeout does not work for some sites. the scripts sometimes wait up to 60 seconds for response of some hosts (seems to be a php configuration limit).
this…

Martin Abraham
- 752
- 7
- 24
1
vote
0 answers
while using proc_open(), my time stamp to terminate the function is not working properly
I am having issues with my php code. I am executing c++rom fffff code using proc_open() in php.
//from another function I'm calling this function with parameters execute("code.exe", $STDIN, 0.02, 268435456 * 2);
//my c++ code is already executed to…

Mihail Kostov
- 11
- 1
1
vote
2 answers
Program to do word/phrase replacement exceeds the time limit
Sorry for the possibly long and dumb question, but I'm really stumped. I'm doing a task for the university. Its meaning is very simple. You need to implement a function that will change the "bad" phrases to "good". Input to the function is a text…

w.ilia.m
- 11
- 3
1
vote
0 answers
Performance test not pass for almostIncreseSequence at CodeSignal
yes I know there are a few similar questions about this problem that's why I will skip the intro about it. All of them have different codes but nothing identical to mine and I couldn't understand and fix the problem with my code. So the problem with…

elsartz
- 11
- 3
1
vote
1 answer
Time Limit Exceed for BFS algorithm
It is leetcode #200, number of islands.
My code is
def numIslands(self, grid: List[List[str]]) -> int:
def bfs(i,j):
q = deque([[i,j]])
while q:
r,c = q.popleft()
if 0<=r

R__
- 87
- 5
1
vote
1 answer
React Suspense time limit
guys! I am relatively new to the concept of Suspense in React so i apologize if the question answer is obvious but i couldn't manage to find similar question asked before.
So i was wondering how can i set/simulate time limit for Suspense. Assuming i…

Sasho32
- 25
- 4
1
vote
1 answer
Runtime Exceeded for Best Time to Buy and Sell Stock 3
This is my code for leetcode problem - Best Time to Buy and Sell Stock 3
and my Golang code passes 203/214 test cases. My time limit gets exceeded for a particular input array of size 10k. Any ideas?
By basic algorithm goes as follows :-
Find…

Vayun
- 95
- 1
- 10