mirror of
https://github.com/nasrlol/torque.git
synced 2025-11-27 23:09:21 +01:00
chore: folder refactor, start of zio implementation
This commit is contained in:
parent
fcad65fc51
commit
d6f99d058b
@ -1,9 +1,9 @@
|
|||||||
package com.nsrddyn.alu
|
package com.nsrddyn.alu
|
||||||
|
import com.nsrddyn.alu.Prime
|
||||||
|
|
||||||
import com.nsrddyn.tools.Benchmark
|
import com.nsrddyn.tools.Benchmark
|
||||||
|
import com.nsrddyn.test
|
||||||
|
|
||||||
class Prime() extends Benchmark {
|
class Prime() extends {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate all primes up to limit
|
* Calculate all primes up to limit
|
||||||
@ -40,3 +40,25 @@ class Prime() extends Benchmark {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class PrimeRunner extends Workload {
|
||||||
|
|
||||||
|
def run(threads: Int): Unit = {
|
||||||
|
|
||||||
|
val pr = new Prime()
|
||||||
|
val br = new Benchmark()
|
||||||
|
|
||||||
|
/*
|
||||||
|
* test cases
|
||||||
|
*
|
||||||
|
* 7919 true
|
||||||
|
* 2147483647 false
|
||||||
|
*/
|
||||||
|
|
||||||
|
val time = pr.run(7919, true)
|
||||||
|
println(time)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
package com.nsrddyn.Enums
|
|
||||||
|
|
||||||
enum Status:
|
|
||||||
case PASS
|
|
||||||
case FAIL
|
|
||||||
|
|
||||||
@ -6,6 +6,11 @@ import java.time.Instant
|
|||||||
import com.nsrddyn.alu.*
|
import com.nsrddyn.alu.*
|
||||||
import com.nsrddyn.tools.Benchmark
|
import com.nsrddyn.tools.Benchmark
|
||||||
|
|
||||||
|
enum Status:
|
||||||
|
case PASS
|
||||||
|
case FAIL
|
||||||
|
|
||||||
|
|
||||||
object Torque {
|
object Torque {
|
||||||
|
|
||||||
println("hello world")
|
println("hello world")
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
package com.nsrddyn.Test
|
|
||||||
|
|
||||||
import com.nsrddyn.alu.Prime
|
|
||||||
import com.nsrddyn.tools.Benchmark
|
|
||||||
|
|
||||||
class PrimeTest extends Prime {
|
|
||||||
|
|
||||||
def runBasic(): Unit = {
|
|
||||||
|
|
||||||
val pr = new Prime()
|
|
||||||
val br = new Benchmark()
|
|
||||||
|
|
||||||
/*
|
|
||||||
* test cases
|
|
||||||
*
|
|
||||||
* 7919 true
|
|
||||||
* 2147483647 false
|
|
||||||
*/
|
|
||||||
|
|
||||||
val time = pr.run(7919, true)
|
|
||||||
println(time)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
def runExtreme(): Unit = println("running some very have stuff!")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
9
src/main/scala/com/nsrddyn/Traits/Workload.scala
Normal file
9
src/main/scala/com/nsrddyn/Traits/Workload.scala
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package com.nsrddyn.Traits
|
||||||
|
|
||||||
|
import zio._
|
||||||
|
|
||||||
|
trait Workload {
|
||||||
|
|
||||||
|
def name: String
|
||||||
|
def run: ZIO[Any, Nothing, Unit]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user