shithub: orca

Download patch

ref: e4562fa250aa010e1cab060acbe52da62454e9ce
parent: 0927bbcd7f04299e91151dd6fd432390c203bcb2
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Aug 7 13:09:43 EDT 2020

plan9: nanosec: call nsec _or_ cycles

--- a/plan9.c
+++ b/plan9.c
@@ -502,12 +502,14 @@
 		return nsec() - xstart;
 
 	if(fasthz == 0){
-		xstart = nsec();
 		if((fasthz = _tos->cyclefreq) == 0){
 			fasthz = ~0ULL;
+			xstart = nsec();
 			fprint(2, "cyclefreq not available, falling back to nsec()\n");
 			fprint(2, "you might want to disable aux/timesync\n");
 			return 0;
+		}else{
+			cycles(&xstart);
 		}
 	}
 	cycles(&x);