Skip to content

Commit

Permalink
Improved computation endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai George authored and Mihai George committed Jul 6, 2017
1 parent ac88682 commit 7b18ad2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dotnet-core/Controllers/MyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public IEnumerable<string> compute()
int x = 0, y = 1, z, max;

Random r = new Random();
max = 1000000 + r.Next(50000);
max = 10000 + r.Next(500);

for (int i = 0; i <= max; i++) {
z = x + y;
Expand Down
2 changes: 1 addition & 1 deletion java-spring/src/main/java/app/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String compute() throws JSONException {
long x = 0, y = 1, z, max;

Random r = new Random();
max = 1000000 + r.nextInt(50000);
max = 10000 + r.nextInt(500);

for (int i = 0; i <= max; i++) {
z = x + y;
Expand Down
2 changes: 1 addition & 1 deletion node-express/app/Controllers/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Controller
compute(req, res) {
let x = 0, y = 1;

let max = 1000000 + Math.random() * 50000;
let max = 10000 + Math.random() * 500;

for (let i = 0; i <= max; i++) {
let z = x + y;
Expand Down
2 changes: 1 addition & 1 deletion php-laravel/app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function compute()
{
$x = 0; $y = 1;

$max = 1000000 + rand(0, 50000);
$max = 10000 + rand(0, 500);

for ($i = 0; $i <= $max; $i++) {
$z = $x + $y;
Expand Down
2 changes: 1 addition & 1 deletion python-django/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def compute(req):
x = 0
y = 1

max = 1000000 + randint(0, 50000)
max = 10000 + randint(0, 500)

for i in range(max):
z = x + y
Expand Down

0 comments on commit 7b18ad2

Please sign in to comment.