Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for go_start_profile (0.66 sec)

  1. src/cmd/cgo/internal/testcarchive/testdata/libgo6/sigprof.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"io"
    	"runtime/pprof"
    )
    
    import "C"
    
    //export go_start_profile
    func go_start_profile() {
    	pprof.StartCPUProfile(io.Discard)
    }
    
    //export go_stop_profile
    func go_stop_profile() {
    	pprof.StopCPUProfile()
    }
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 404 bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/testcarchive/testdata/main6.c

    #include <stddef.h>
    #include <sys/time.h>
    
    #include "libgo6.h"
    
    int main(int argc, char **argv) {
    	struct timeval tvstart, tvnow;
    	int diff;
    
    	gettimeofday(&tvstart, NULL);
    
    	go_start_profile();
    
    	// Busy wait so we have something to profile.
    	// If we just sleep the profiling signal will never fire.
    	while (1) {
    		gettimeofday(&tvnow, NULL);
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 830 bytes
    - Viewed (0)
Back to top