-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestClass.java
More file actions
37 lines (29 loc) · 1.05 KB
/
testClass.java
File metadata and controls
37 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.company;
import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
public class testClass {
public static void main(String[] args) {
BufferedImage bi = null, bj = null;
Rectangle rect = new Rectangle(0, 0, 810, 384);
long startTime, finishTime;
startTime = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
bi = JNAScreenShot.getScreenshot(rect);
}
finishTime = System.currentTimeMillis();
System.out.println("With JNA Library: " + (finishTime - startTime)/1000);
Robot robo = null;
startTime = System.currentTimeMillis();
try {
robo = new Robot();
} catch (AWTException a) {
}
for (int i = 0; i < 10; i++) {
bj = robo.createScreenCapture(rect);
}
finishTime = System.currentTimeMillis();
System.out.println("With Robot Class " + (finishTime - startTime)/1000);
}
}