Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
Parallel Programming Lab 1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
julanar.ali
Parallel Programming Lab 1
Commits
42e6fde7
Commit
42e6fde7
authored
Oct 31, 2023
by
julanar.ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding PrimerFinderTestClass
parent
543c3868
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
3 deletions
+36
-3
vcs.xml
.idea/vcs.xml
+6
-0
pom.xml
pom.xml
+7
-1
PrimerFinderTest.java
src/main/java/PrimerFinder/PrimerFinderTest.java
+21
-0
Main.java
src/main/java/Runnable/Main.java
+2
-2
PrimerFinderTest.class
target/classes/PrimerFinder/PrimerFinderTest.class
+0
-0
Main.class
target/classes/Runnable/Main.class
+0
-0
No files found.
.idea/vcs.xml
0 → 100644
View file @
42e6fde7
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
pom.xml
View file @
42e6fde7
...
...
@@ -7,7 +7,13 @@
<groupId>
org.example
</groupId>
<artifactId>
PrimerFinder
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.13.2
</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>
11
</maven.compiler.source>
<maven.compiler.target>
11
</maven.compiler.target>
...
...
src/main/java/PrimerFinder/PrimerFinderTest.java
0 → 100644
View file @
42e6fde7
package
PrimerFinder
;
import
junit.framework.TestCase
;
import
java.util.List
;
public
class
PrimerFinderTest
extends
TestCase
{
public
void
testParallelPrimerFinder
(){
int
threadsNum
=
4
;
int
rangeStart
=
1
;
int
rangeEnd
=
100000000
;
long
starter
=
System
.
currentTimeMillis
();
ParallelPrimerFinder
parallelPrimerFinder
=
new
ParallelPrimerFinder
(
threadsNum
);
List
<
Integer
>
primes
=
parallelPrimerFinder
.
primesFinder
(
rangeStart
,
rangeEnd
);
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"Prime numbers between 1 and 100,000,000: "
);
System
.
out
.
println
(
primes
);
long
time
=
end
-
starter
;
System
.
out
.
println
(
"The Time of finding Primes numbers between 1 and 100,000,000: "
+
time
+
" Millis"
);
}
}
src/main/java/Runnable/Main.java
View file @
42e6fde7
...
...
@@ -7,7 +7,7 @@ import java.util.List;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
int
threadsNum
=
100
;
/* int threadsNum=8
;
int rangeStart = 1;
int rangeEnd = 100000000;
long starter= System.currentTimeMillis();
...
...
@@ -16,6 +16,6 @@ public class Main {
long end=System.currentTimeMillis();
System.out.println("Prime numbers between 1 and 100,000,000: " + primes);
long time=end-starter;
System
.
out
.
println
(
"The Time of finding Primes numbers between 1 and 100,000,000: "
+
time
+
" Millis"
);
System.out.println("The Time of finding Primes numbers between 1 and 100,000,000: "+time +" Millis");
*/
}
}
\ No newline at end of file
target/classes/PrimerFinder/PrimerFinderTest.class
0 → 100644
View file @
42e6fde7
File added
target/classes/Runnable/Main.class
View file @
42e6fde7
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment