Skip to content

Commit 75b2a44

Browse files
committed
More minimalistic, calling only a child process without timers etc
1 parent 8a34c65 commit 75b2a44

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

frameless_window.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
<link rel="stylesheet" type="text/css" href="style.css" />
66
<script src="titlebar.js"></script>
7-
<script src="frameless_window.js"></script>
87
</head>
98

109
<body>
@@ -19,5 +18,7 @@
1918
<button id="close-window-button">Close Window</button>
2019
</div>
2120
</div>
21+
22+
<script src="frameless_window.js"></script>
2223
</body>
2324
</html>

frameless_window.js

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/**
3-
* This code shows the problem with issue #7715 on NWJS
3+
* This code shows the problem with issue #7715 on NWJS -- version 2, showing that a child process is the problem
44
*
55
* Go into folder with package.json, and run below commands. Time spend is shown in window.
66
*
@@ -27,23 +27,12 @@ window.onload = function() {
2727
//
2828

2929

30-
const simpleGit = require('simple-git'); // npm install simple-git
31-
32-
const delayInMs = 1000;
33-
window.setInterval( _update, delayInMs ); // continuously call _update
34-
35-
async function _update(){
36-
37-
var startTime = performance.now();
38-
39-
var isRepo;
40-
await simpleGit().checkIsRepo(onCheckIsRepo);
41-
function onCheckIsRepo(err, checkResult) {
42-
isRepo = checkResult
43-
console.log(' ');
44-
console.log(`_update took ${ performance.now() - startTime} ms (at onCheckIsRepo)`);
45-
document.getElementById('time').innerText = `${ performance.now() - startTime} ms`;
46-
}
47-
48-
49-
}
30+
var startTime = performance.now();
31+
32+
const { exec } = require("child_process")
33+
exec('git')
34+
35+
36+
console.log(' ');
37+
console.log(`_update took ${ performance.now() - startTime} ms (at _update3)`);
38+
document.getElementById('time').innerText = `${ performance.now() - startTime} ms`;

0 commit comments

Comments
 (0)