summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-09-06 06:11:46 +0000
committerOmar Rizwan <omar@omar.website>2023-09-06 06:11:46 +0000
commit6b426aa5853d8aa4d389a36f076a8cf416a3c91c (patch)
tree392563e15f331c4c65936f2089049622c069a02c /virtual-programs
parentMerge branch 'zspotter/term-cleaning' (diff)
downloadfolk-6b426aa5853d8aa4d389a36f076a8cf416a3c91c.tar.gz
folk-6b426aa5853d8aa4d389a36f076a8cf416a3c91c.zip
Some peering cleanup (receive before Step); build in FPS counting
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/camera.folk9
-rw-r--r--virtual-programs/display.folk13
2 files changed, 4 insertions, 18 deletions
diff --git a/virtual-programs/camera.folk b/virtual-programs/camera.folk
index 225a5880..0a95c8f0 100644
--- a/virtual-programs/camera.folk
+++ b/virtual-programs/camera.folk
@@ -20,15 +20,12 @@ On process {
puts "Camera tid: [getTid] booting at [clock milliseconds]"
- while true {
- set cameraTime [time {
- set grayFrame [Camera::grayFrame]
- }]
+ When $::thisProcess has step count /c/ {
+ set grayFrame [Camera::grayFrame]
Commit {
- Claim the camera time is $cameraTime
+ Claim the camera time is $::stepTime
Claim the camera frame is $grayFrame at [clock milliseconds]
}
- Step
}
}
diff --git a/virtual-programs/display.folk b/virtual-programs/display.folk
index c73b354c..d3f6b610 100644
--- a/virtual-programs/display.folk
+++ b/virtual-programs/display.folk
@@ -59,7 +59,6 @@ On process {
Wish $::thisProcess shares statements like \
[list /someone/ claims the display time is /displayTime/]
- set ::frames [list]
while true {
set displayList [list]
foreach match [Statements::findMatches {/someone/ wishes display runs /command/ on layer /layer/}] {
@@ -84,17 +83,7 @@ On process {
set renderTime [baretime [list foreach command $displayCommands { {*}$command }]]
set commitTime [baretime commitThenClearStaging]
- set framesInLastSecond 0
- set now [clock milliseconds]
- lappend frames $now
- foreach frame $frames {
- if {$frame > $now - 1000} {
- incr framesInLastSecond
- }
- }
- set frames [lreplace $frames 0 end-$framesInLastSecond]
-
- Commit { Claim the display time is "render $renderTime us + commit $commitTime us ($::stepTime) ($framesInLastSecond fps)" }
+ Commit { Claim the display time is "render $renderTime us + commit $commitTime us ($::stepTime)" }
Step
}
}